diff --git a/cli/runtime.go b/cli/runtime.go index ac5159b7e..7a1dce974 100644 --- a/cli/runtime.go +++ b/cli/runtime.go @@ -1,3 +1,3 @@ package main -const genpolicyPath = "genpolicy" +var genpolicyPath = "genpolicy" diff --git a/packages/default.nix b/packages/default.nix index 0f89a5ff6..8b5f0dac2 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -44,14 +44,13 @@ rec { proxyVendor = true; vendorHash = "sha256-8j8uZ0D07l6tdAd+rpZidsdXZ0IxptfgmxaDogvbgLk="; - postPatch = '' - echo subsituting genpolicyPath - substituteInPlace cli/runtime.go \ - --replace 'genpolicyPath = "genpolicy"' 'genpolicyPath = "${genpolicy}/bin/genpolicy"' - ''; - CGO_ENABLED = 0; - ldflags = [ "-s" "-w" "-buildid=" ]; + ldflags = [ + "-s" + "-w" + "-buildid=" + "-X main.genpolicyPath=${genpolicy}/bin/genpolicy" + ]; preCheck = '' export CGO_ENABLED=1