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
This commit is contained in:
Kamil Chmielewski
2016-09-10 12:04:13 +02:00
committed by zimbatm
parent 7a6b860e1c
commit 914e0e594c
173 changed files with 4176 additions and 4127 deletions

View File

@@ -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;