buildGoModule: inherit env from main package to goModule derivation
This commit is contained in:
parent
51af9f69ac
commit
3e28bdc678
7 changed files with 7 additions and 5 deletions
|
@ -142,6 +142,7 @@ Many attributes [controlling the build phase](#variables-controlling-the-build-p
|
|||
- [`patchFlags`](#var-stdenv-patchFlags)
|
||||
- [`postPatch`](#var-stdenv-postPatch)
|
||||
- [`preBuild`](#var-stdenv-preBuild)
|
||||
- `env`: useful for passing down variables such as `GOWORK`.
|
||||
|
||||
To control test execution of the build derivation, the following attributes are of interest:
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ buildGoModule rec {
|
|||
|
||||
vendorHash = "sha256-8YcJXvR0cdL9PlP74Qh6uN2XZoN16sz/yeeZlBsk5N8=";
|
||||
|
||||
GOWORK = "off";
|
||||
env.GOWORK = "off";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
|
|
|
@ -15,7 +15,7 @@ buildGoModule rec {
|
|||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
GOWORK = "off";
|
||||
env.GOWORK = "off";
|
||||
|
||||
subPackages = [ "cmd/talosctl" ];
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ let
|
|||
preBuild = args.preBuild or "";
|
||||
postBuild = args.modPostBuild or "";
|
||||
sourceRoot = args.sourceRoot or "";
|
||||
env = args.env or { };
|
||||
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
|
||||
"GIT_PROXY_COMMAND"
|
||||
|
|
|
@ -20,7 +20,7 @@ buildGoModule {
|
|||
|
||||
modRoot = "go/cli/mcap";
|
||||
|
||||
GOWORK="off";
|
||||
env.GOWORK="off";
|
||||
|
||||
# copy the local versions of the workspace modules
|
||||
postConfigure = ''
|
||||
|
|
|
@ -19,7 +19,7 @@ buildGoModule rec {
|
|||
|
||||
subPackages = [ "cmd/policy" ];
|
||||
# disable go workspaces
|
||||
GOWORK = "off";
|
||||
env.GOWORK = "off";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ buildGoModule rec {
|
|||
|
||||
subPackages = [ "cmd" ];
|
||||
|
||||
GOWORK = "off";
|
||||
env.GOWORK = "off";
|
||||
|
||||
modRoot = "v2";
|
||||
|
||||
|
|
Loading…
Reference in a new issue