scripts: environment: Only rewrite user-specified mappings.

* guix/scripts/environment.scm (launch-environment/container): Only
  apply override-user-mappings to user-mappings and cwd. Do not apply to
  network configuration mapping and inputs.
This commit is contained in:
Carl Dong 2019-06-29 16:59:22 -04:00 committed by Carl Dong
parent 0971f8bd88
commit a655d504aa
No known key found for this signature in database
GPG key ID: 0CC52153197991A5

View file

@ -479,26 +479,27 @@ (define* (launch-environment/container #:key command bash user user-mappings
;; /bin/sh, the current working directory, and possibly networking
;; configuration files within the container.
(mappings
(override-user-mappings
user home
(append user-mappings
;; Current working directory.
(list (file-system-mapping
(source cwd)
(target cwd)
(writable? #t)))
;; When in Rome, do as Nix build.cc does: Automagically
;; map common network configuration files.
(if network?
%network-file-mappings
'())
;; Mappings for the union closure of all inputs.
(map (lambda (dir)
(file-system-mapping
(source dir)
(target dir)
(writable? #f)))
reqs))))
(append
(override-user-mappings
user home
(append user-mappings
;; Current working directory.
(list (file-system-mapping
(source cwd)
(target cwd)
(writable? #t)))))
;; When in Rome, do as Nix build.cc does: Automagically
;; map common network configuration files.
(if network?
%network-file-mappings
'())
;; Mappings for the union closure of all inputs.
(map (lambda (dir)
(file-system-mapping
(source dir)
(target dir)
(writable? #f)))
reqs)))
(file-systems (append %container-file-systems
(map file-system-mapping->bind-mount
mappings))))