M guix/scripts/environment.scm => guix/scripts/environment.scm +8 -0
@@ 770,6 770,13 @@ added to the container.
Preserve environment variables whose name matches the one of the regexps in
WHILE-LIST."
+ (define tmpfs
+ (file-system
+ (device "none")
+ (mount-point "/tmp")
+ (type "tmpfs")
+ (check? #f)))
+
(define (optional-mapping->fs mapping)
(and (file-exists? (file-system-mapping-source mapping))
(file-system-mapping->bind-mount mapping)))
@@ 867,6 874,7 @@ WHILE-LIST."
(writable? #f)))
reqs)))
(file-systems (append %container-file-systems
+ (list tmpfs)
(if network?
(filter-map optional-mapping->fs
%network-file-mappings)
M guix/scripts/home.scm => guix/scripts/home.scm +6 -1
@@ 353,7 353,12 @@ immediately. Return the exit status of the process in the container."
#:namespaces (if network?
(delq 'net %namespaces) ; share host network
%namespaces)
- #:mounts (list (file-system
+ #:mounts (list (file-system ;writable /tmp
+ (device "none")
+ (mount-point "/tmp")
+ (type "tmpfs")
+ (check? #f))
+ (file-system
(device "none")
(mount-point
(in-vicinity "/run/user" ;for shepherd & co.
M tests/guix-environment-container.sh => tests/guix-environment-container.sh +5 -0
@@ 195,6 195,11 @@ guix environment --bootstrap --container --ad-hoc guile-bootstrap \
--writable-root \
-- guile -c '(mkdir "/whatever")'
+# /tmp itself is always writable.
+guix environment --bootstrap --container --ad-hoc guile-bootstrap \
+ -- guile -c '(mkdir "/tmp/foo")'
+
+
# Check the exit code.
abnormal_exit_code="