From 11e88de06043d367d02ceceade84733a65f84e27 Mon Sep 17 00:00:00 2001 From: Tomas Volf <~@wolfsden.cz> Date: Sun, 18 May 2025 15:39:36 +0200 Subject: [PATCH] environment: Make home writable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * 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 --- guix/scripts/environment.scm | 9 ++++++++- tests/guix-environment-container.sh | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index bc06e97d7b5..96bbc6c9fae 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 d0f19c83725..e1c36558465 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.