diff options
author | Kamil Chmielewski <kamil.chm@gmail.com> | 2016-06-17 17:51:29 +0200 |
---|---|---|
committer | Kamil Chmielewski <kamil.chm@gmail.com> | 2016-08-31 18:38:49 +0200 |
commit | c9f9147beda330b69d66c387c2fb2076af8520d2 (patch) | |
tree | 06ab7601535a84011058135fbf5a130446b20f1c | |
parent | 6d9296c3c794baca9181d9c51392a66db8c83eb5 (diff) |
buildGoPackage: include goDeps in nix-shell GOPATH
-rw-r--r-- | pkgs/development/go-modules/generic/default.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 72c91daac401d..f4ca037376a20 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -180,6 +180,16 @@ go.stdenv.mkDerivation ( done < <(find $bin/bin -type f 2>/dev/null) ''; + shellHook = '' + d=$(mktemp -d "--suffix=-$name") + '' + toString (map (dep: '' + mkdir -p "$d/src/$(dirname "${dep.goPackagePath}")" + ln -s "${dep.src}" "$d/src/${dep.goPackagePath}" + '' + ) goPath) + '' + export GOPATH="$d:$GOPATH" + ''; + disallowedReferences = lib.optional (!allowGoReference) go ++ lib.optional (!dontRenameImports) govers; |