about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorOliver Dunkl <oliver.dunkl@gmail.com>2015-01-28T12·09+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-01-28T12·39+0100
commitde91a42c6ed6f35adae2ca0be6ad9ce556aac335 (patch)
tree8aea2cf77da12f532acd466a9f1064e8e0429b24 /scripts
parentf46e329a1332738694973d67d70dc5e32c5eda40 (diff)
Moves runHook to a later execution position
It moves runHook to a later position in the rcfile. After that we are
able to set the PS1 environment-variable for a nix-shell environment
e.g.:

  # turn the color of the prompt to blue
  shellHook = ''
    export PS1="\n\[\033[1;34m\][\u@\h:\w]$\[\033[0m\] ";
  '';
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nix-build.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 4339899fc074..ca43041b77b0 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -278,10 +278,10 @@ 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\] "; ' .
+            'if [ "$(type -t runHook)" = function ]; then runHook shellHook; fi; ' .
             'unset NIX_ENFORCE_PURITY; ' .
             'unset NIX_INDENT_MAKE; ' .
             'shopt -u nullglob; ' .