From 61aa5ee1fbbb143ba8879dfc764bfb61a1f88274 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 7 Oct 2022 15:46:29 +0200 Subject: [PATCH] Upgrade nebula to 1.6.1 --- nix/nebula.nix | 8 +++++--- nix/pkgs.nix | 32 ++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 13 deletions(-) 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 {