nix-shell: Execute shellHook if it exists
Since normal builds don't execute shellHook, this allows nix-shell specific customisation. Suggested by Domen.
This commit is contained 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\] "; ' .
|
||||
|
||||
Reference in New Issue
Block a user