diff options
author | Kamil Chmielewski <kamil.chm@gmail.com> | 2016-09-10 12:04:13 +0200 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2016-09-16 00:04:55 +0100 |
commit | 914e0e594ca2d0fa5d456be208bf703d79f04fa3 (patch) | |
tree | 49cabb000804d24bb798de8afaacaa7fac8a41c8 /pkgs/development/go-modules | |
parent | 7a6b860e1c5c6e35719631ff3599521144990077 (diff) |
buildGoPackage: deps.json -> deps.nix in NIXON
https://github.com/NixOS/nixpkgs/pull/17254#issuecomment-245295541
* update docs to describe `deps.nix`
* include goDeps in nix-shell GOPATH
* NixOS 16.09 rel notes about replacing goPackages
Diffstat (limited to 'pkgs/development/go-modules')
-rw-r--r-- | pkgs/development/go-modules/generic/default.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 18bbdef8758e..d4d2790b2a3c 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -56,7 +56,7 @@ let }; importGodeps = { depsFile }: - map dep2src (lib.importJSON depsFile); + map dep2src (import depsFile); goPath = if goDeps != null then importGodeps { depsFile = goDeps; } ++ extraSrcs else extraSrcs; @@ -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; |