diff options
Diffstat (limited to 'gnu/system/linux-container.scm')
| -rw-r--r-- | gnu/system/linux-container.scm | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm index 3acc579a6b9..d3c0036f47b 100644 --- a/gnu/system/linux-container.scm +++ b/gnu/system/linux-container.scm | |||
| @@ -87,30 +87,29 @@ that will be shared with the host system." | |||
| 87 | #:container? #t))) | 87 | #:container? #t))) |
| 88 | 88 | ||
| 89 | (define script | 89 | (define script |
| 90 | #~(begin | 90 | (with-imported-modules '((guix config) |
| 91 | (use-modules (gnu build linux-container) | 91 | (guix utils) |
| 92 | (guix build utils)) | 92 | (guix combinators) |
| 93 | (guix build utils) | ||
| 94 | (guix build syscalls) | ||
| 95 | (guix build bournish) | ||
| 96 | (gnu build file-systems) | ||
| 97 | (gnu build linux-container)) | ||
| 98 | #~(begin | ||
| 99 | (use-modules (gnu build linux-container) | ||
| 100 | (guix build utils)) | ||
| 93 | 101 | ||
| 94 | (call-with-container '#$specs | 102 | (call-with-container '#$specs |
| 95 | (lambda () | 103 | (lambda () |
| 96 | (setenv "HOME" "/root") | 104 | (setenv "HOME" "/root") |
| 97 | (setenv "TMPDIR" "/tmp") | 105 | (setenv "TMPDIR" "/tmp") |
| 98 | (setenv "GUIX_NEW_SYSTEM" #$os-drv) | 106 | (setenv "GUIX_NEW_SYSTEM" #$os-drv) |
| 99 | (for-each mkdir-p '("/run" "/bin" "/etc" "/home" "/var")) | 107 | (for-each mkdir-p '("/run" "/bin" "/etc" "/home" "/var")) |
| 100 | (primitive-load (string-append #$os-drv "/boot"))) | 108 | (primitive-load (string-append #$os-drv "/boot"))) |
| 101 | ;; A range of 65536 uid/gids is used to cover 16 bits worth of | 109 | ;; A range of 65536 uid/gids is used to cover 16 bits worth of |
| 102 | ;; users and groups, which is sufficient for most cases. | 110 | ;; users and groups, which is sufficient for most cases. |
| 103 | ;; | 111 | ;; |
| 104 | ;; See: http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--private-users= | 112 | ;; See: http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--private-users= |
| 105 | #:host-uids 65536))) | 113 | #:host-uids 65536)))) |
| 106 | 114 | ||
| 107 | (gexp->script "run-container" script | 115 | (gexp->script "run-container" script)))) |
| 108 | #:modules '((ice-9 match) | ||
| 109 | (srfi srfi-98) | ||
| 110 | (guix config) | ||
| 111 | (guix utils) | ||
| 112 | (guix build utils) | ||
| 113 | (guix build syscalls) | ||
| 114 | (guix build bournish) | ||
| 115 | (gnu build file-systems) | ||
| 116 | (gnu build linux-container)))))) | ||
