From 3bc5be29254d1f00b628a2bcc3bce16c385629d2 Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Tue, 17 Sep 2024 18:52:47 -0400 Subject: [PATCH] Update the build process for newest nixpkgs 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. --- flake.lock | 56 ++++++++++++++++++++++++------------------------------ flake.nix | 15 +++++++++++++-- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index e6d25d1..fdfa145 100644 --- a/flake.lock +++ b/flake.lock @@ -21,10 +21,10 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", - "path": "/nix/store/2hc9lg18zd6yabw9jqj0wy3s9kyvkzp0-source", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "lastModified": 1725234343, + "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "path": "/nix/store/8ql43f4sxqh1dbpqy2q5jz11zdwf9832-source", + "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", "type": "path" }, "original": { @@ -37,11 +37,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -55,11 +55,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710346304, - "narHash": "sha256-vwoyBoCovK7+vdbCYqL9MssoFQjaXtZN8sElcjUdbx8=", + "lastModified": 1726583932, + "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a0906f14161a5c5792e9883117b9471f5bf6df72", + "rev": "658e7223191d2598641d50ee4e898126768fe847", "type": "github" }, "original": { @@ -86,29 +86,23 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", - "type": "github" + "lastModified": 1725233747, + "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" } }, "nixpkgs_2": { "locked": { - "lastModified": 1707619277, - "narHash": "sha256-vKnYD5GMQbNQyyQm4wRlqi+5n0/F1hnvqSQgaBy4BqY=", + "lastModified": 1724748588, + "narHash": "sha256-NlpGA4+AIf1dKNq76ps90rxowlFXUsV9x7vK/mN37JM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f3a93440fbfff8a74350f4791332a19282cc6dc8", + "rev": "a6292e34000dc93d43bccf78338770c1c5ec8a99", "type": "github" }, "original": { @@ -163,11 +157,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1710376267, - "narHash": "sha256-3flXAIoz4lGtNPdFYY2ZemGJbMzfEbPJhtn7HrvvH2A=", + "lastModified": 1726603168, + "narHash": "sha256-u/XTK6crhEUxju5rlNgMdxzcbs7epCpJ39SgYIcdEN4=", "owner": "tailscale", "repo": "tailscale", - "rev": "decd9893e48bf8aba31055088f44527c6d871802", + "rev": "5f89c932749e28093629c6cfedf58a9aa532ee89", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8603ec2..aec20bc 100644 --- a/flake.nix +++ b/flake.nix @@ -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 <