buildGoModule: inherit env from main package to goModule derivation

This commit is contained in:
Yongun Seong 2024-04-06 02:29:45 +09:00
parent 51af9f69ac
commit 3e28bdc678
No known key found for this signature in database
7 changed files with 7 additions and 5 deletions

View file

@ -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:

View file

@ -13,7 +13,7 @@ buildGoModule rec {
vendorHash = "sha256-8YcJXvR0cdL9PlP74Qh6uN2XZoN16sz/yeeZlBsk5N8=";
GOWORK = "off";
env.GOWORK = "off";
nativeBuildInputs = [
installShellFiles

View file

@ -15,7 +15,7 @@ buildGoModule rec {
ldflags = [ "-s" "-w" ];
GOWORK = "off";
env.GOWORK = "off";
subPackages = [ "cmd/talosctl" ];

View file

@ -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"

View file

@ -20,7 +20,7 @@ buildGoModule {
modRoot = "go/cli/mcap";
GOWORK="off";
env.GOWORK="off";
# copy the local versions of the workspace modules
postConfigure = ''

View file

@ -19,7 +19,7 @@ buildGoModule rec {
subPackages = [ "cmd/policy" ];
# disable go workspaces
GOWORK = "off";
env.GOWORK = "off";
doCheck = false;

View file

@ -15,7 +15,7 @@ buildGoModule rec {
subPackages = [ "cmd" ];
GOWORK = "off";
env.GOWORK = "off";
modRoot = "v2";