summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-02 18:44:17 +0100
committerLudovic Courtès <ludo@gnu.org>2015-11-02 22:25:11 +0100
commitd62e201cfd0f1e48c14586489d0e2b80ce943d4f (patch)
treed6c4989b36b54f154f21363ac72bd9896729f2de /gnu/system
parent3a391e68dafe81560d3e4936a1ec5ac3b06d43bb (diff)
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.
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/linux-container.scm18
1 files changed, 3 insertions, 15 deletions
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index c2eb773931d..4f38c5cb0aa 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -47,20 +47,6 @@
47 (check? #f) 47 (check? #f)
48 (create-mount-point? #t))))) 48 (create-mount-point? #t)))))
49 49
50(define (system-container os)
51 "Return a derivation that builds OS as a Linux container."
52 (mlet* %store-monad
53 ((profile (operating-system-profile os))
54 (etc -> (operating-system-etc-directory os))
55 (boot (operating-system-boot-script os #:container? #t))
56 (locale (operating-system-locale-directory os)))
57 (lower-object
58 (file-union "system-container"
59 `(("boot" ,#~#$boot)
60 ("profile" ,#~#$profile)
61 ("locale" ,#~#$locale)
62 ("etc" ,#~#$etc))))))
63
64(define (containerized-operating-system os mappings) 50(define (containerized-operating-system os mappings)
65 "Return an operating system based on OS for use in a Linux container 51 "Return an operating system based on OS for use in a Linux container
66environment. MAPPINGS is a list of <file-system-mapping> to realize in the 52environment. MAPPINGS is a list of <file-system-mapping> to realize in the
@@ -95,7 +81,9 @@ that will be shared with the host system."
95 (operating-system-file-systems os))) 81 (operating-system-file-systems os)))
96 (specs (map file-system->spec file-systems))) 82 (specs (map file-system->spec file-systems)))
97 83
98 (mlet* %store-monad ((os-drv (system-container os))) 84 (mlet* %store-monad ((os-drv (operating-system-derivation
85 os
86 #:container? #t)))
99 87
100 (define script 88 (define script
101 #~(begin 89 #~(begin