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.
This commit is contained in:
Ludovic Courtès 2015-07-01 14:39:14 +02:00
parent 50500f7cf0
commit 28de8d258b
3 changed files with 25 additions and 2 deletions

View file

@ -78,7 +78,11 @@ search paths."
(if (and current (not pure?))
(string-append value separator current)
value)))))
(evaluate-input-search-paths inputs paths)))
(evaluate-input-search-paths inputs paths))
;; Give users a way to know that they're in 'guix environment', so they can
;; adjust 'PS1' accordingly, for instance.
(setenv "GUIX_ENVIRONMENT" "t"))
(define (show-search-paths inputs search-paths pure?)
"Display SEARCH-PATHS applied to the packages specified by INPUTS, a list of