diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-17 13:34:24 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-17 13:34:24 +0100 |
commit | e81d38c02b267eea93a91de3e8a00b185355d681 (patch) | |
tree | c0ffb0c0b00d592771d635a96279221d8730431b /scripts/nix-build.in | |
parent | 832377bbd6ccd43895ac346131cafe4901f7996b (diff) |
nix-shell: Execute shellHook if it exists
Since normal builds don't execute shellHook, this allows nix-shell
specific customisation. Suggested by Domen.
Diffstat (limited to 'scripts/nix-build.in')
-rwxr-xr-x | scripts/nix-build.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in index fff71021f..c197dcca9 100755 --- a/scripts/nix-build.in +++ b/scripts/nix-build.in @@ -207,6 +207,7 @@ foreach my $expr (@exprs) { ($pure ? '' : 'p=$PATH; ' ) . 'dontAddDisableDepTrack=1; ' . '[ -e $stdenv/setup ] && source $stdenv/setup; ' . + 'if [ "$(type -t runHook)" = function ]; then runHook shellHook; fi; ' . ($pure ? '' : 'PATH=$PATH:$p; unset p; ') . 'set +e; ' . '[ -n "$PS1" ] && PS1="\n\[\033[1;32m\][nix-shell:\w]$\[\033[0m\] "; ' . |