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:
parent
832377bbd6
commit
e81d38c02b
2 changed files with 17 additions and 0 deletions
|
@ -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\] "; ' .
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue