diff --git a/pkgs/development/go-packages/generic/default.nix b/pkgs/development/go-packages/generic/default.nix index 0a1b3a9a2948..8a093a03d1c1 100644 --- a/pkgs/development/go-packages/generic/default.nix +++ b/pkgs/development/go-packages/generic/default.nix @@ -35,6 +35,8 @@ # IE: programs coupled with the compiler , allowGoReference ? false +, CGO_ENABLED ? go.CGO_ENABLED + , meta ? {}, ... } @ args: @@ -75,11 +77,13 @@ let ++ (lib.optional (!dontRenameImports) govers) ++ nativeBuildInputs; buildInputs = buildInputs; - inherit (go) GOOS GOARCH GO386 CGO_ENABLED; + inherit (go) GOOS GOARCH GO386; GOHOSTARCH = go.GOHOSTARCH or null; GOHOSTOS = go.GOHOSTOS or null; + inherit CGO_ENABLED; + GO111MODULE = "off"; GOFLAGS = lib.optionals (!allowGoReference) [ "-trimpath" ];