Skip to content

Commit

Permalink
Update the build process for newest nixpkgs
Browse files Browse the repository at this point in the history
Since buildGoPackage is on its way out (and warns), let's instead use
buildGoModule, with a faked-up go.mod file; thankfully nardump has
zero dependencies besides the stdlib, so we can easily do that.
  • Loading branch information
antifuchs committed Sep 17, 2024
1 parent c7d30d1 commit 3bc5be2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 33 deletions.
56 changes: 25 additions & 31 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@

packages = {
default = config.packages.nardump;
nardump = pkgs.buildGoPackage rec {
nardump = pkgs.buildGo123Module rec {
pname = "nardump";
version = inputs.tailscale.rev;
src = "${inputs.tailscale}/cmd/nardump";
goPackagePath = "github.com/tailscale/tailscale/cmd/nardump";
vendorHash = null;

# Fake up a go module inside the nardump dir, so we don't
# have to download & cache the entirety of tailscale's
# deps:
prePatch = ''
cat >go.mod <<EOF
module github.com/tailscale/tailscale/cmd/nardump
go 1.23.0
require ()
EOF
'';
};
};
};
Expand Down

0 comments on commit 3bc5be2

Please sign in to comment.