Merge pull request #43657 from nlewo/pr-go-shellhook

buildGoPackage: add shellHook attribute
This commit is contained in:
Jaka Hudoklin 2018-07-23 13:33:56 +02:00 committed by GitHub
commit 34abb79686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
, removeReferencesTo, fetchFromGitHub }:
{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? ""
, shellHook ? ""
# We want parallel builds by default
, enableParallelBuilding ? true
@ -198,7 +199,7 @@ go.stdenv.mkDerivation (
''
) goPath) + ''
export GOPATH=${lib.concatStringsSep ":" ( ["$d"] ++ ["$GOPATH"] ++ ["$PWD"] ++ extraSrcPaths)}
'';
'' + shellHook;
disallowedReferences = lib.optional (!allowGoReference) go
++ lib.optional (!dontRenameImports) govers;