From 8078757b887a7691644b119913c3f7b41661775d Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Sun, 22 Oct 2023 15:54:54 -0400 Subject: [PATCH] nonguix: multiarch-container: Allow extra shared directories. Basic fix for #237. This allows exposing other directories or drives to the nonguix container, for example to add additional library locations to Steam, by setting $GUIX_SANDBOX_EXTRA_SHARES. * nonguix/multiarch-container.scm (make-container-wrapper): Use environment variable $GUIX_SANDBOX_EXTRA_SHARES to pass extra directories to share with the container. --- nonguix/multiarch-container.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nonguix/multiarch-container.scm b/nonguix/multiarch-container.scm index 6cbd14a..8b54d40 100644 --- a/nonguix/multiarch-container.scm +++ b/nonguix/multiarch-container.scm @@ -335,6 +335,9 @@ in a sandboxed FHS environment." ,@(exists-> (getenv "XAUTHORITY")) #$@(ngc-shared container))) (DEBUG (equal? (getenv "DEBUG") "1")) + (extra-shares (if (getenv "GUIX_SANDBOX_EXTRA_SHARES") + (string-split (getenv "GUIX_SANDBOX_EXTRA_SHARES") #\:) + #f)) (args (cdr (command-line))) (command (if DEBUG '() `("--" ,run ,@args)))) @@ -363,7 +366,9 @@ in a sandboxed FHS environment." ,@(map add-path expose) ,@(map (lambda (item) (add-path item #:writable? #t)) - share) + (if extra-shares + (append share extra-shares) + share)) "-m" ,manifest-file ,@command)))))))