diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-11-02 21:52:28 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-11-02 22:25:12 +0100 |
commit | af4c3fd5e37d477bffce167909fbc0776a860204 (patch) | |
tree | b055a36138d5033d9acf64a1b4c86f968d0caa9b /gnu/system.scm | |
parent | d62e201cfd0f1e48c14586489d0e2b80ce943d4f (diff) | |
download | patches-af4c3fd5e37d477bffce167909fbc0776a860204.tar patches-af4c3fd5e37d477bffce167909fbc0776a860204.tar.gz |
services: Add 'profile-service-type'.
* gnu/services.scm (packages->profile-entry): New procedure.
(profile-service-type): New variable.
* gnu/system.scm (operating-system-directory-base-entries): Remove
the "profile" entry.
(essential-services): Add a PROFILE-SERVICE-TYPE instance.
(operating-system-profile): Rewrite in terms of 'fold-services'.
* doc/guix.texi (Service Reference): Add 'profile-service-type'.
* doc/images/service-graph.dot: Likewise.
Diffstat (limited to 'gnu/system.scm')
-rw-r--r-- | gnu/system.scm | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index c26d27028b..85a596ddb9 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -257,11 +257,9 @@ from the initrd." (define* (operating-system-directory-base-entries os #:key container?) "Return the basic entries of the 'system' directory of OS for use as the value of the SYSTEM-SERVICE-TYPE service." - (mlet* %store-monad ((profile (operating-system-profile os)) - (locale (operating-system-locale-directory os))) + (mlet %store-monad ((locale (operating-system-locale-directory os))) (if container? - (return `(("profile" ,profile) - ("locale" ,locale))) + (return `(("locale" ,locale))) (mlet %store-monad ((kernel -> (operating-system-kernel os)) (initrd (operating-system-initrd-file os)) @@ -269,7 +267,6 @@ value of the SYSTEM-SERVICE-TYPE service." (return `(("kernel" ,kernel) ("parameters" ,params) ("initrd" ,initrd) - ("profile" ,profile) ("locale" ,locale))))))) ;used by libc (define* (essential-services os #:key container?) @@ -305,6 +302,8 @@ a container or that of a \"bare metal\" system." host-name procs root-fs unmount (service setuid-program-service-type (operating-system-setuid-programs os)) + (service profile-service-type + (operating-system-packages os)) (append other-fs mappings swaps ;; Add the firmware service, unless we are building for a @@ -534,11 +533,6 @@ fi\n"))) #$(operating-system-timezone os))) ("sudoers" ,(operating-system-sudoers-file os)))))) -(define (operating-system-profile os) - "Return a derivation that builds the system profile of OS." - (profile-derivation (manifest (map package->manifest-entry - (operating-system-packages os))))) - (define %root-account ;; Default root account. (user-account @@ -639,6 +633,16 @@ hardware-related operations as necessary when booting a Linux container." ;; SYSTEM contains the derivation as a monadic value. (service-parameters system))) +(define* (operating-system-profile os #:key container?) + "Return a derivation that builds the system profile of OS." + (mlet* %store-monad + ((services -> (operating-system-services os #:container? container?)) + (profile (fold-services services + #:target-type profile-service-type))) + (match profile + (("profile" profile) + (return profile))))) + (define (operating-system-root-file-system os) "Return the root file system of OS." (find (match-lambda |