mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-10 08:30:39 +02:00
services: Add 'system-service-type'.
* gnu/services.scm (system-derivation): New procedure. (system-service-type): New variable. (boot-script-entry): New procedure. (boot-service-type): Extend SYSTEM-SERVICE-TYPE. (etc-entry): New procedure. (etc-service-type): Extend SYSTEM-SERVICE-TYPE. (fold-services): Change default #:target-type to SYSTEM-SERVICE-TYPE. * gnu/system.scm (operating-system-directory-base-entries): New procedure. (essential-services): Use it. Add an instance of SYSTEM-SERVICE-TYPE. (operating-system-boot-script): Pass #:target-type to 'fold-services'. (operating-system-derivation): Rewrite in terms of 'fold-services'. * gnu/system/linux-container.scm (system-container): Remove. (container-script): Use 'operating-system-derivation'. * guix/scripts/system.scm (export-extension-graph): Replace BOOT-SERVICE-TYPE by SYSTEM-SERVICE-TYPE. * doc/images/service-graph.dot: Add 'system' node and edges. * doc/guix.texi (Service Composition): Mention SYSTEM-SERVICE-TYPE. (Service Reference): Document it. Update 'fold-services' documentation.
This commit is contained in:
parent
3a391e68da
commit
d62e201cfd
6 changed files with 103 additions and 57 deletions
|
@ -47,20 +47,6 @@
|
|||
(check? #f)
|
||||
(create-mount-point? #t)))))
|
||||
|
||||
(define (system-container os)
|
||||
"Return a derivation that builds OS as a Linux container."
|
||||
(mlet* %store-monad
|
||||
((profile (operating-system-profile os))
|
||||
(etc -> (operating-system-etc-directory os))
|
||||
(boot (operating-system-boot-script os #:container? #t))
|
||||
(locale (operating-system-locale-directory os)))
|
||||
(lower-object
|
||||
(file-union "system-container"
|
||||
`(("boot" ,#~#$boot)
|
||||
("profile" ,#~#$profile)
|
||||
("locale" ,#~#$locale)
|
||||
("etc" ,#~#$etc))))))
|
||||
|
||||
(define (containerized-operating-system os mappings)
|
||||
"Return an operating system based on OS for use in a Linux container
|
||||
environment. MAPPINGS is a list of <file-system-mapping> to realize in the
|
||||
|
@ -95,7 +81,9 @@ that will be shared with the host system."
|
|||
(operating-system-file-systems os)))
|
||||
(specs (map file-system->spec file-systems)))
|
||||
|
||||
(mlet* %store-monad ((os-drv (system-container os)))
|
||||
(mlet* %store-monad ((os-drv (operating-system-derivation
|
||||
os
|
||||
#:container? #t)))
|
||||
|
||||
(define script
|
||||
#~(begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue