From f8527e7f2044ec7bb19efcb25158ec7aa0fe5fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 19 May 2025 21:28:14 +0200 Subject: [PATCH] environment: Provide a writable /run/user/$UID. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/environment.scm (launch-environment/container): Add /run/user/UID to ‘file-systems’. * tests/guix-environment-container.sh: Test it. Change-Id: I44c70a7554a06f40d073c25929ea7c6ded356d08 --- guix/scripts/environment.scm | 5 +++++ tests/guix-environment-container.sh | 3 +++ 2 files changed, 8 insertions(+) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 96bbc6c9fa..1c2d222c74 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -875,6 +875,11 @@ WHILE-LIST." reqs))) (file-systems (append %container-file-systems (list tmpfs ; RW /tmp + (file-system ; RW /run + (inherit tmpfs) + (mount-point + (string-append "/run/user/" + (number->string uid)))) (file-system ; RW ~ (device "none") (mount-point diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index e1c3655846..220e6b8ec8 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -203,6 +203,9 @@ guix environment --bootstrap --container --ad-hoc guile-bootstrap \ guix environment --bootstrap --container --ad-hoc guile-bootstrap \ -- guile -c '(mkdir (string-append (getenv "HOME") "/foo"))' +# And /run too! +guix environment --bootstrap --container --ad-hoc guile-bootstrap \ + -- guile -c '(mkdir "/run/user/1000/shepherd")' # Check the exit code.