diff --git a/pkgs/tools/networking/opensnitch/daemon.nix b/pkgs/tools/networking/opensnitch/daemon.nix index 1d81627bf29c..98c7f51ba71e 100644 --- a/pkgs/tools/networking/opensnitch/daemon.nix +++ b/pkgs/tools/networking/opensnitch/daemon.nix @@ -27,6 +27,11 @@ buildGoModule rec { hash = "sha256-C8Uuz2FC7Zu07ZmFpp+ejpNxkyC3/mM9J2dc5FUKx64="; }; + postPatch = '' + # Allow configuring Version at build time + substituteInPlace daemon/core/version.go --replace "const " "var " + ''; + modRoot = "daemon"; buildInputs = [ @@ -65,6 +70,8 @@ buildGoModule rec { --replace "/bin/mkdir" "${coreutils}/bin/mkdir" ''; + ldflags = [ "-s" "-w" "-X github.com/evilsocket/opensnitch/daemon/core.Version=${version}" ]; + postInstall = '' wrapProgram $out/bin/opensnitchd \ --prefix PATH : ${lib.makeBinPath [ iptables ]} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47e5b9a8b302..832774f98e05 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11494,9 +11494,7 @@ with pkgs; openfortivpn = callPackage ../tools/networking/openfortivpn { }; opensnitch = callPackage ../tools/networking/opensnitch/daemon.nix { - # Build currently fails on Go > 1.18 - # See https://github.com/evilsocket/opensnitch/issues/851 - buildGoModule = buildGo118Module; + buildGoModule = buildGo121Module; }; opensnitch-ui = libsForQt5.callPackage ../tools/networking/opensnitch/ui.nix { };