goPackages.tools: add setup-hook for setting GOTOOLDIR

This commit is contained in:
Luca Bruno 2015-10-28 11:00:54 +01:00
parent e1a392e031
commit b080efe4dc
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1 @@
export GOTOOLDIR=@bin@/bin

View file

@ -133,6 +133,14 @@ let
# Do not copy this without a good reason for enabling
# In this case tools is heavily coupled with go itself and embeds paths.
allowGoReference = true;
# Set GOTOOLDIR for derivations adding this to buildInputs
postInstall = ''
mkdir -p $bin/nix-support
substituteAll ${../development/go-modules/tools/setup-hook.sh} $bin/nix-support/setup-hook.tmp
cat $bin/nix-support/setup-hook.tmp >> $bin/nix-support/setup-hook
rm $bin/nix-support/setup-hook.tmp
'';
};