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.
This commit is contained in:
John Kehayias 2023-10-22 15:54:54 -04:00
parent 9a502ae1b0
commit 8078757b88
No known key found for this signature in database
GPG key ID: 499097AE5EA815D9

View file

@ -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)))))))