summary refs log tree commit diff
path: root/gnu/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-01 14:39:14 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-01 23:29:49 +0200
commit28de8d258b30f887053d43b2d75a7ed5e2fa2adc (patch)
treeed0cb7f5c487d7d93bfc5e11472eac0ea81f2443 /gnu/system
parent50500f7cf0786cccb8211ddac75a56c3c82859f6 (diff)
downloadguix-28de8d258b30f887053d43b2d75a7ed5e2fa2adc.tar.gz
environment: Define 'GUIX_ENVIRONMENT'.
* guix/scripts/environment.scm (create-environment): Define 'GUIX_ENVIRONMENT'.
* doc/guix.texi (Invoking guix environment): Document it.
* gnu/system/shadow.scm (default-skeletons): Adjust 'PS1' depending on whether
  'GUIX_ENVIRONMENT' is defined.
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/shadow.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index aa97652678..ae6229229b 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -153,7 +153,13 @@ then
     source /etc/profile
 fi
 
-PS1='\\u@\\h \\w\\$ '
+# Adjust the prompt depending on whether we're in 'guix environment'.
+if [ -n \"$GUIX_ENVIRONMENT\" ]
+then
+    export PS1='\\u@\\h \\w\\ [env]$ '
+else
+    export PS1='\\u@\\h \\w\\$ '
+fi
 alias ls='ls -p --color'
 alias ll='ls -l'\n"))
                       (zlogin (text-file "zlogin" "\