mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-16 03:45:24 -05:00
environment: Set USER and LOGNAME in container
* guix/scripts/environment.scm (launch-environment/container): Set username environment variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
769b948f7f
commit
bc8be17c4d
1 changed files with 5 additions and 0 deletions
|
@ -477,6 +477,7 @@ (define (optional-mapping->fs mapping)
|
|||
(group-entry (gid 65534) ;the overflow GID
|
||||
(name "overflow"))))
|
||||
(home-dir (password-entry-directory passwd))
|
||||
(logname (password-entry-name passwd))
|
||||
(environ (filter (match-lambda
|
||||
((variable . value)
|
||||
(find (cut regexp-exec <> variable)
|
||||
|
@ -528,6 +529,10 @@ (define (optional-mapping->fs mapping)
|
|||
;; The same variables as in Nix's 'build.cc'.
|
||||
'("TMPDIR" "TEMPDIR" "TMP" "TEMP"))
|
||||
|
||||
;; Some programs expect USER and/or LOGNAME to be set.
|
||||
(setenv "LOGNAME" logname)
|
||||
(setenv "USER" logname)
|
||||
|
||||
;; Create a dummy home directory.
|
||||
(mkdir-p home-dir)
|
||||
(setenv "HOME" home-dir)
|
||||
|
|
Loading…
Reference in a new issue