From 28de8d258b30f887053d43b2d75a7ed5e2fa2adc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Jul 2015 14:39:14 +0200 Subject: 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. --- gnu/system/shadow.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gnu') 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" "\ -- cgit v1.2.3