about summary refs log tree commit diff
path: root/scripts/nix-build.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nix-build.in')
-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 4bf85ae138d8..8ac95e90e59e 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -209,7 +209,7 @@ foreach my $expr (@exprs) {
             '[ -e $stdenv/setup ] && source $stdenv/setup; ' .
             ($pure ? '' : 'PATH=$PATH:$p; ') .
             'set +e; ' .
-            'PS1="\n\[\033[1;32m\][nix-shell:\w]$\[\033[0m\] "; ' .
+            '[ -n "$PS1" ] && PS1="\n\[\033[1;32m\][nix-shell:\w]$\[\033[0m\] "; ' .
             'unset NIX_ENFORCE_PURITY; ' .
             'shopt -u nullglob; ' .
             $envCommand);