diff --git a/nix/nebula.nix b/nix/nebula.nix index d3f891a..98bde7e 100644 --- a/nix/nebula.nix +++ b/nix/nebula.nix @@ -10,16 +10,18 @@ # If this changes, remember to change: # - the AppDir/etc/daemon.yml vpn.firewall docs # - the version imported in go-workspace - version = "1.4.0"; + version = "1.6.1"; src = fetchFromGitHub { owner = "slackhq"; repo = pname; rev = "v${version}"; - sha256 = "lu2/rSB9cFD7VUiK+niuqCX9CI2x+k4Pi+U5yksETSU="; + sha256 = "sha256-IsLSlQsrfw3obkz4jHL23BRQY2fviGbPEvs5j0zkdX0="; }; - vendorSha256 = "p1inJ9+NAb2d81cn+y+ofhxFz9ObUiLgj+9cACa6Jqg="; + vendorSha256 = "sha256-GvMiOEC3Y/pGG++Z+XCgLVADKymUR9shDxjx3xIz8u0="; subPackages = [ "cmd/nebula" "cmd/nebula-cert" ]; + + ldflags = [ "-X main.Build=${version}" ]; } diff --git a/nix/pkgs.nix b/nix/pkgs.nix index d55d27c..9bf4561 100644 --- a/nix/pkgs.nix +++ b/nix/pkgs.nix @@ -2,21 +2,33 @@ rec { overlays = [ - (final: prev: { + # Make both buildGoModules use static compilation by default. + (final: prev: - # make buildGoModule default to static compilation - buildGoModule = args: prev.buildGoModule ({ - doCheck = false; - CGO_ENABLED=0; - tags = [ "netgo" "timetzdata" ]; - ldflags = [ "-w" "-extldflags=-static" ]; - } // args); + let - }) + buildArgs = { + doCheck = false; + CGO_ENABLED=0; + tags = [ "netgo" "timetzdata" ]; + ldflags = [ "-w" "-extldflags=-static" ]; + }; + + in { + + buildGoModule = args: prev.buildGoModule (buildArgs // args); + buildGo118Module = args: prev.buildGo118Module (buildArgs // args); + + } + ) (final: prev: { rebase = prev.callPackage ./rebase.nix {}; }) (final: prev: { yq-go = prev.callPackage ./yq-go.nix {}; }) - (final: prev: { nebula = prev.callPackage ./nebula.nix {}; }) + + (final: prev: { nebula = prev.callPackage ./nebula.nix { + buildGoModule = prev.buildGo118Module; + }; }) + ]; stableSrc = fetchTarball {