scripts: environment: Fix ordering issue with CWD and --expose.

Fixes <https://issues.guix.gnu.org/46782>.

* guix/scripts/environment.scm (launch-environment/container): Move the CWD
mapping to the front of the file system mappings.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Josselin Poiret 2023-02-13 22:31:21 +01:00 committed by Maxim Cournoyer
parent 61a0b03c65
commit aca64d5604
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -767,14 +767,17 @@ (define fhs-mappings
(append
(override-user-mappings
user home
(append user-mappings
;; Share current working directory, unless asked not to.
(if map-cwd?
(list (file-system-mapping
(source cwd)
(target cwd)
(writable? #t)))
'())))
(append
;; Share current working directory, unless asked not to.
(if map-cwd?
(list (file-system-mapping
(source cwd)
(target cwd)
(writable? #t)))
'())
;; Add the user mappings *after* the current working directory
;; so that a user can layer bind mounts on top of it.
user-mappings))
;; Mappings for the union closure of all inputs.
(map (lambda (dir)
(file-system-mapping