aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Volf <~@wolfsden.cz>2025-05-18 15:39:36 +0200
committerLudovic Courtès <ludo@gnu.org>2025-05-18 22:55:54 +0200
commit11e88de06043d367d02ceceade84733a65f84e27 (patch)
treedf181a194a5c32f77e71ab3b716e62a28be6352f
parent7a888d98415da19dd45653dac78c41ee738ec253 (diff)
downloadguix-11e88de06043d367d02ceceade84733a65f84e27.tar.gz
guix-11e88de06043d367d02ceceade84733a65f84e27.zip
environment: Make home writable.
Fixes <https://issues.guix.gnu.org/78363>. * guix/scripts/environment.scm (launch-environment/container): Add tmpfs for home. * tests/guix-environment-container.sh: Add test. Change-Id: Iadd9b838f6442a8080998ed7e07414db562068bf Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/scripts/environment.scm9
-rw-r--r--tests/guix-environment-container.sh4
2 files changed, 12 insertions, 1 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index bc06e97d7b..96bbc6c9fa 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -874,7 +874,14 @@ WHILE-LIST."
(writable? #f)))
reqs)))
(file-systems (append %container-file-systems
- (list tmpfs)
+ (list tmpfs ; RW /tmp
+ (file-system ; RW ~
+ (device "none")
+ (mount-point
+ (or (and=> user user-override-home)
+ home))
+ (type "tmpfs")
+ (check? #f)))
(if network?
(filter-map optional-mapping->fs
%network-file-mappings)
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index d0f19c8372..e1c3655846 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -199,6 +199,10 @@ guix environment --bootstrap --container --ad-hoc guile-bootstrap \
guix environment --bootstrap --container --ad-hoc guile-bootstrap \
-- guile -c '(mkdir "/tmp/foo")'
+# And so is ~.
+guix environment --bootstrap --container --ad-hoc guile-bootstrap \
+ -- guile -c '(mkdir (string-append (getenv "HOME") "/foo"))'
+
# Check the exit code.