diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 00ba03533e34..b1e1a23eea71 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -250,7 +250,7 @@ lib.extendMkDerivation { ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" - (lib.optional (!allowGoReference) "-trimpath"); + (lib.optional (!finalAttrs.allowGoReference) "-trimpath"); inherit enableParallelBuilding; @@ -410,7 +410,8 @@ lib.extendMkDerivation { strictDeps = true; - disallowedReferences = lib.optional (!allowGoReference) go; + inherit allowGoReference; + disallowedReferences = lib.optional (!finalAttrs.allowGoReference) go; passthru = { inherit go;