1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu services)
21 #:use-module (guix gexp)
22 #:use-module (guix monads)
23 #:use-module (guix store)
24 #:use-module (guix records)
25 #:use-module (guix profiles)
26 #:use-module (guix discovery)
27 #:use-module (guix combinators)
28 #:use-module (guix channels)
29 #:use-module (guix describe)
30 #:use-module (guix sets)
31 #:use-module (guix ui)
32 #:use-module ((guix utils) #:select (source-properties->location))
33 #:use-module (guix modules)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages bash)
36 #:use-module (srfi srfi-1)
37 #:use-module (srfi srfi-9)
38 #:use-module (srfi srfi-9 gnu)
39 #:use-module (srfi srfi-26)
40 #:use-module (srfi srfi-34)
41 #:use-module (srfi srfi-35)
42 #:use-module (ice-9 vlist)
43 #:use-module (ice-9 match)
44 #:autoload (ice-9 pretty-print) (pretty-print)
45 #:export (service-extension
47 service-extension-target
48 service-extension-compute
53 service-type-extensions
56 service-type-default-value
57 service-type-description
68 service-parameters ;deprecated
73 instantiate-missing-services
77 missing-value-service-error?
78 missing-value-service-error-type
79 missing-value-service-error-location
80 missing-target-service-error?
81 missing-target-service-error-service
82 missing-target-service-error-target-type
83 ambiguous-target-service-error?
84 ambiguous-target-service-error-service
85 ambiguous-target-service-error-target-type
88 provenance-service-type
91 activation-service-type
92 activation-service->script
93 %linux-bare-metal-service
94 special-files-service-type
98 setuid-program-service-type
100 firmware-service-type
109 ;;; This module defines a broad notion of "service types" and "services."
111 ;;; A service type describe how its instances extend instances of other
112 ;;; service types. For instance, some services extend the instance of
113 ;;; ACCOUNT-SERVICE-TYPE by providing it with accounts and groups to create;
114 ;;; others extend SHEPHERD-ROOT-SERVICE-TYPE by passing it instances of
115 ;;; <shepherd-service>.
117 ;;; When applicable, the service type defines how it can itself be extended,
118 ;;; by providing one procedure to compose extensions, and one procedure to
121 ;;; A notable service type is SYSTEM-SERVICE-TYPE, which has a single
122 ;;; instance, which is the root of the service DAG. Its value is the
123 ;;; derivation that produces the 'system' directory as returned by
124 ;;; 'operating-system-derivation'.
126 ;;; The 'fold-services' procedure can be passed a list of procedures, which it
127 ;;; "folds" by propagating extensions down the graph; it returns the root
128 ;;; service after the applying all its extensions.
132 (define-record-type <service-extension>
133 (service-extension target compute)
135 (target service-extension-target) ;<service-type>
136 (compute service-extension-compute)) ;params -> params
138 (define &no-default-value
139 ;; Value used to denote service types that have no associated default value.
142 (define-record-type* <service-type> service-type make-service-type
144 (name service-type-name) ;symbol (for debugging)
146 ;; Things extended by services of this type.
147 (extensions service-type-extensions) ;list of <service-extensions>
149 ;; Given a list of extensions, "compose" them.
150 (compose service-type-compose ;list of Any -> Any
153 ;; Extend the services' own parameters with the extension composition.
154 (extend service-type-extend ;list of Any -> parameters
157 ;; Optional default value for instances of this type.
158 (default-value service-type-default-value ;Any
159 (default &no-default-value))
162 (description service-type-description ;string
164 (location service-type-location ;<location>
165 (default (and=> (current-source-location)
166 source-properties->location))
169 (define (write-service-type type port)
170 (format port "#<service-type ~a ~a>"
171 (service-type-name type)
172 (number->string (object-address type) 16)))
174 (set-record-type-printer! <service-type> write-service-type)
176 (define %distro-root-directory
177 ;; Absolute file name of the module hierarchy.
178 (dirname (search-path %load-path "guix.scm")))
180 (define %service-type-path
181 ;; Search path for service types.
182 (make-parameter `((,%distro-root-directory . "gnu/services")
183 (,%distro-root-directory . "gnu/system"))))
185 (define (all-service-modules)
186 "Return the default set of service modules."
187 (cons (resolve-interface '(gnu services))
188 (all-modules (%service-type-path)
189 #:warn warn-about-load-error)))
191 (define* (fold-service-types proc seed
193 (modules (all-service-modules)))
194 "For each service type exported by one of MODULES, call (PROC RESULT). SEED
195 is used as the initial value of RESULT."
196 (fold-module-public-variables (lambda (object result)
197 (if (service-type? object)
203 (define lookup-service-types
205 (delay (fold-service-types (lambda (type result)
206 (vhash-consq (service-type-name type)
210 "Return the list of services with the given NAME (a symbol)."
211 (vhash-foldq* cons '() name (force table)))))
213 ;; Services of a given type.
214 (define-record-type <service>
215 (make-service type value)
218 (value service-value))
220 (define-syntax service
222 "Return a service instance of TYPE. The service value is VALUE or, if
223 omitted, TYPE's default value."
225 (make-service type value))
227 (%service-with-default-value (current-source-location)
230 (define (%service-with-default-value location type)
231 "Return a instance of service type TYPE with its default value, if any. If
232 TYPE does not have a default value, an error is raised."
233 ;; TODO: Currently this is a run-time error but with a little bit macrology
234 ;; we could turn it into an expansion-time error.
235 (let ((default (service-type-default-value type)))
236 (if (eq? default &no-default-value)
237 (let ((location (source-properties->location location)))
240 (&missing-value-service-error (type type) (location location))
242 (message (format #f (G_ "~a: no value specified \
243 for service of type '~a'")
244 (location->string location)
245 (service-type-name type)))))))
246 (service type default))))
248 (define-condition-type &service-error &error
251 (define-condition-type &missing-value-service-error &service-error
252 missing-value-service-error?
253 (type missing-value-service-error-type)
254 (location missing-value-service-error-location))
262 (define service-parameters
266 (define (simple-service name target value)
267 "Return a service that extends TARGET with VALUE. This works by creating a
268 singleton service type NAME, of which the returned service is an instance."
269 (let* ((extension (service-extension target identity))
270 (type (service-type (name name)
271 (extensions (list extension)))))
272 (service type value)))
274 (define-syntax %modify-service
278 ((_ svc (kind param => exp ...) clauses ...)
279 (if (eq? (service-kind svc) kind)
280 (let ((param (service-value svc)))
281 (service (service-kind svc)
283 (%modify-service svc clauses ...)))))
285 (define-syntax modify-services
287 "Modify the services listed in SERVICES according to CLAUSES and return
288 the resulting list of services. Each clause must have the form:
290 (TYPE VARIABLE => BODY)
292 where TYPE is a service type, such as 'guix-service-type', and VARIABLE is an
293 identifier that is bound within BODY to the value of the service of that
294 TYPE. Consider this example:
296 (modify-services %base-services
297 (guix-service-type config =>
300 (use-substitutes? #f)
301 (extra-options '(\"--gc-keep-derivations\"))))
302 (mingetty-service-type config =>
303 (mingetty-configuration
305 (motd (plain-file \"motd\" \"Hi there!\")))))
307 It changes the configuration of the GUIX-SERVICE-TYPE instance, and that of
308 all the MINGETTY-SERVICE-TYPE instances.
310 This is a shorthand for (map (lambda (svc) ...) %base-services)."
311 ((_ services clauses ...)
312 (map (lambda (service)
313 (%modify-service service clauses ...))
321 (define (system-derivation entries mextensions)
322 "Return as a monadic value the derivation of the 'system' directory
323 containing the given entries."
324 (mlet %store-monad ((extensions (mapm/accumulate-builds identity
328 (append entries (concatenate extensions))))))
330 (define system-service-type
331 ;; This is the ultimate service type, the root of the service DAG. The
332 ;; service of this type is extended by monadic name/item pairs. These items
333 ;; end up in the "system directory" as returned by
334 ;; 'operating-system-derivation'.
335 (service-type (name 'system)
338 (extend system-derivation)
340 "Build the operating system top-level directory, which in
341 turn refers to everything the operating system needs: its kernel, initrd,
342 system profile, boot script, and so on.")))
344 (define (compute-boot-script _ gexps)
345 ;; Reverse GEXPS so that extensions appear in the boot script in the right
346 ;; order. That is, user extensions would come first, and extensions added
347 ;; by 'essential-services' (e.g., running shepherd) are guaranteed to come
350 ;; Clean up and activate the system, then spawn shepherd.
351 #~(begin #$@(reverse gexps))))
353 (define (boot-script-entry mboot)
354 "Return, as a monadic value, an entry for the boot script in the system
356 (mlet %store-monad ((boot mboot))
357 (return `(("boot" ,boot)))))
359 (define boot-service-type
360 ;; The service of this type is extended by being passed gexps. It
361 ;; aggregates them in a single script, as a monadic value, which becomes its
363 (service-type (name 'boot)
365 (list (service-extension system-service-type
368 (extend compute-boot-script)
370 "Produce the operating system's boot script, which is spawned
371 by the initrd once the root file system is mounted.")))
373 (define %boot-service
374 ;; The service that produces the boot script.
375 (service boot-service-type #t))
379 ;;; Provenance tracking.
382 (define (object->pretty-string obj)
383 "Like 'object->string', but using 'pretty-print'."
384 (call-with-output-string
386 (pretty-print obj port))))
388 (define (channel->code channel)
389 "Return code to build CHANNEL, ready to be dropped in a 'channels.scm'
391 `(channel (name ',(channel-name channel))
392 (url ,(channel-url channel))
393 (branch ,(channel-branch channel))
394 (commit ,(channel-commit channel))))
396 (define (channel->sexp channel)
397 "Return an sexp describing CHANNEL. The sexp is _not_ code and is meant to
398 be parsed by tools; it's potentially more future-proof than code."
399 `(channel (name ,(channel-name channel))
400 (url ,(channel-url channel))
401 (branch ,(channel-branch channel))
402 (commit ,(channel-commit channel))))
404 (define (provenance-file channels config-file)
405 "Return a 'provenance' file describing CHANNELS, a list of channels, and
406 CONFIG-FILE, which can be either #f or a <local-file> containing the OS
407 configuration being used."
408 (scheme-file "provenance"
411 (channels #+@(if channels
412 (map channel->sexp channels)
414 (configuration-file #+config-file))))
416 (define (provenance-entry config-file)
417 "Return system entries describing the operating system provenance: the
418 channels in use and CONFIG-FILE, if it is true."
423 (and=> profile profile-channels))
426 (let ((config-file (cond ((string? config-file)
427 (local-file config-file "configuration.scm"))
432 (return `(("provenance" ,(provenance-file channels config-file))
435 ,(plain-file "channels.scm"
436 (object->pretty-string
438 ,@(map channel->code channels))))))
441 `(("configuration.scm" ,config-file))
444 (define provenance-service-type
445 (service-type (name 'provenance)
447 (list (service-extension system-service-type
449 (default-value #f) ;the OS config file
451 "Store provenance information about the system in the system
452 itself: the channels used when building the system, and its configuration
453 file, when available.")))
460 (define (cleanup-gexp _)
461 "Return a gexp to clean up /tmp and similar places upon boot."
462 (with-imported-modules '((guix build utils))
464 (use-modules (guix build utils))
466 ;; Clean out /tmp and /var/run.
468 ;; XXX This needs to happen before service activations, so it
469 ;; has to be here, but this also implicitly assumes that /tmp
470 ;; and /var/run are on the root partition.
471 (letrec-syntax ((fail-safe (syntax-rules ()
477 (fail-safe rest ...)))
480 ;; Ignore I/O errors so the system can boot.
482 ;; Remove stale Shadow lock files as they would lead to
483 ;; failures of 'useradd' & co.
484 (delete-file "/etc/group.lock")
485 (delete-file "/etc/passwd.lock")
486 (delete-file "/etc/.pwd.lock") ;from 'lckpwdf'
488 ;; Force file names to be decoded as UTF-8. See
489 ;; <https://bugs.gnu.org/26353>.
490 (setenv "GUIX_LOCPATH"
491 #+(file-append glibc-utf8-locales "/lib/locale"))
492 (setlocale LC_CTYPE "en_US.utf8")
493 (delete-file-recursively "/tmp")
494 (delete-file-recursively "/var/run")
497 (chmod "/tmp" #o1777)
499 (chmod "/var/run" #o755)
500 (delete-file-recursively "/run/udev/watch.old"))))))
502 (define cleanup-service-type
503 ;; Service that cleans things up in /tmp and similar.
504 (service-type (name 'cleanup)
506 (list (service-extension boot-service-type
509 "Delete files from @file{/tmp}, @file{/var/run}, and other
510 temporary locations at boot time.")))
512 (define* (activation-service->script service)
513 "Return as a monadic value the activation script for SERVICE, a service of
514 ACTIVATION-SCRIPT-TYPE."
515 (activation-script (service-value service)))
517 (define (activation-script gexps)
518 "Return the system's activation script, which evaluates GEXPS."
520 (map (cut program-file "activate-service.scm" <>) gexps))
522 (program-file "activate.scm"
523 (with-imported-modules (source-module-closure
524 '((gnu build activation)
527 (use-modules (gnu build activation)
530 ;; Make sure the user accounting database exists. If it
531 ;; does not exist, 'setutxent' does not create it and
532 ;; thus there is no accounting at all.
533 (close-port (open-file "/var/run/utmpx" "a0"))
535 ;; Same for 'wtmp', which is populated by mingetty et
538 (close-port (open-file "/var/log/wtmp" "a0"))
540 ;; Set up /run/current-system. Among other things this
541 ;; sets up locales, which the activation snippets
542 ;; executed below may expect.
543 (activate-current-system)
545 ;; Run the services' activation snippets.
546 ;; TODO: Use 'load-compiled'.
547 (for-each primitive-load '#$actions)))))
549 (define (gexps->activation-gexp gexps)
550 "Return a gexp that runs the activation script containing GEXPS."
551 #~(primitive-load #$(activation-script gexps)))
553 (define (second-argument a b) b)
555 (define activation-service-type
556 (service-type (name 'activate)
558 (list (service-extension boot-service-type
559 gexps->activation-gexp)))
561 (extend second-argument)
563 "Run @dfn{activation} code at boot time and upon
564 @command{guix system reconfigure} completion.")))
566 (define %activation-service
567 ;; The activation service produces the activation script from the gexps it
569 (service activation-service-type #t))
571 (define %modprobe-wrapper
572 ;; Wrapper for the 'modprobe' command that knows where modules live.
574 ;; This wrapper is typically invoked by the Linux kernel ('call_modprobe',
575 ;; in kernel/kmod.c), a situation where the 'LINUX_MODULE_DIRECTORY'
576 ;; environment variable is not set---hence the need for this wrapper.
577 (let ((modprobe "/run/current-system/profile/bin/modprobe"))
578 (program-file "modprobe"
580 (setenv "LINUX_MODULE_DIRECTORY"
581 "/run/booted-system/kernel/lib/modules")
582 ;; FIXME: Remove this crutch when the patch #40422,
583 ;; updating to kmod 27 is merged.
584 (setenv "MODPROBE_OPTIONS"
585 "-C /etc/modprobe.d")
586 (apply execl #$modprobe
587 (cons #$modprobe (cdr (command-line))))))))
589 (define %linux-kernel-activation
590 ;; Activation of the Linux kernel running on the bare metal (as opposed to
591 ;; running in a container.)
593 ;; Tell the kernel to use our 'modprobe' command.
594 (activate-modprobe #$%modprobe-wrapper)
596 ;; Let users debug their own processes!
597 (activate-ptrace-attach)))
599 (define %linux-bare-metal-service
600 ;; The service that does things that are needed on the "bare metal", but not
601 ;; necessary or impossible in a container.
602 (simple-service 'linux-bare-metal
603 activation-service-type
604 %linux-kernel-activation))
607 (define special-files-service-type
608 ;; Service to install "special files" such as /bin/sh and /usr/bin/env.
610 (name 'special-files)
612 (list (service-extension activation-service-type
614 #~(activate-special-files '#$files)))))
615 (compose concatenate)
618 "Add special files to the root file system---e.g.,
619 @file{/usr/bin/env}.")))
621 (define (extra-special-file file target)
622 "Use TARGET as the \"special file\" FILE. For example, TARGET might be
623 (file-append coreutils \"/bin/env\")
624 and FILE could be \"/usr/bin/env\"."
625 (simple-service (string->symbol (string-append "special-file-" file))
626 special-files-service-type
629 (define (etc-directory service)
630 "Return the directory for SERVICE, a service of type ETC-SERVICE-TYPE."
631 (files->etc-directory (service-value service)))
633 (define (files->etc-directory files)
634 (define (assert-no-duplicates files)
635 (let loop ((files files)
640 (when (set-contains? seen file)
643 (message (format #f (G_ "duplicate '~a' entry for /etc")
645 (loop rest (set-insert file seen))))))
647 ;; Detect duplicates early instead of letting them through, eventually
648 ;; leading to a build failure of "etc.drv".
649 (assert-no-duplicates files)
651 (file-union "etc" files))
653 (define (etc-entry files)
654 "Return an entry for the /etc directory consisting of FILES in the system
656 (with-monad %store-monad
657 (return `(("etc" ,(files->etc-directory files))))))
659 (define etc-service-type
660 (service-type (name 'etc)
663 (service-extension activation-service-type
666 (files->etc-directory files)))
667 #~(activate-etc #$etc))))
668 (service-extension system-service-type etc-entry)))
669 (compose concatenate)
671 (description "Populate the @file{/etc} directory.")))
673 (define (etc-service files)
674 "Return a new service of ETC-SERVICE-TYPE that populates /etc with FILES.
675 FILES must be a list of name/file-like object pairs."
676 (service etc-service-type files))
678 (define setuid-program-service-type
679 (service-type (name 'setuid-program)
681 (list (service-extension activation-service-type
683 #~(activate-setuid-programs
684 (list #$@programs))))))
685 (compose concatenate)
688 "Populate @file{/run/setuid-programs} with the specified
689 executables, making them setuid-root.")))
691 (define (packages->profile-entry packages)
692 "Return a system entry for the profile containing PACKAGES."
693 (with-monad %store-monad
694 (return `(("profile" ,(profile
695 (content (packages->manifest
696 (delete-duplicates packages eq?)))))))))
698 (define profile-service-type
699 ;; The service that populates the system's profile---i.e.,
700 ;; /run/current-system/profile. It is extended by package lists.
701 (service-type (name 'profile)
703 (list (service-extension system-service-type
704 packages->profile-entry)))
705 (compose concatenate)
708 "This is the @dfn{system profile}, available as
709 @file{/run/current-system/profile}. It contains packages that the sysadmin
710 wants to be globally available to all the system users.")))
712 (define (firmware->activation-gexp firmware)
713 "Return a gexp to make the packages listed in FIRMWARE loadable by the
715 (let ((directory (directory-union "firmware" firmware)))
716 ;; Tell the kernel where firmware is.
717 #~(activate-firmware (string-append #$directory "/lib/firmware"))))
719 (define firmware-service-type
720 ;; The service that collects firmware.
721 (service-type (name 'firmware)
723 (list (service-extension activation-service-type
724 firmware->activation-gexp)))
725 (compose concatenate)
728 "Make ``firmware'' files loadable by the operating system
729 kernel. Firmware may then be uploaded to some of the machine's devices, such
732 (define (gc-roots->system-entry roots)
733 "Return an entry in the system's output containing symlinks to ROOTS."
734 (mlet %store-monad ((entry (gexp->derivation
736 #~(let ((roots '#$roots))
742 (iota (length roots))))))))
743 (return (if (null? roots)
745 `(("gc-roots" ,entry))))))
747 (define gc-root-service-type
748 ;; A service to associate extra garbage-collector roots to the system. This
749 ;; is a simple hack that guarantees that the system retains references to
750 ;; the given list of roots. Roots must be "lowerable" objects like
751 ;; packages, or derivations.
752 (service-type (name 'gc-roots)
754 (list (service-extension system-service-type
755 gc-roots->system-entry)))
756 (compose concatenate)
759 "Register garbage-collector roots---i.e., store items that
760 will not be reclaimed by the garbage collector.")
761 (default-value '())))
768 (define-condition-type &missing-target-service-error &service-error
769 missing-target-service-error?
770 (service missing-target-service-error-service)
771 (target-type missing-target-service-error-target-type))
773 (define-condition-type &ambiguous-target-service-error &service-error
774 ambiguous-target-service-error?
775 (service ambiguous-target-service-error-service)
776 (target-type ambiguous-target-service-error-target-type))
778 (define (missing-target-error service target-type)
780 (condition (&missing-target-service-error
782 (target-type target-type))
785 (format #f (G_ "no target of type '~a' for service '~a'")
786 (service-type-name target-type)
788 (service-kind service))))))))
790 (define (service-back-edges services)
791 "Return a procedure that, when passed a <service>, returns the list of
792 <service> objects that depend on it."
793 (define (add-edges service edges)
794 (define (add-edge extension edges)
795 (let ((target-type (service-extension-target extension)))
796 (match (filter (lambda (service)
797 (eq? (service-kind service) target-type))
800 (vhash-consq target service edges))
802 (missing-target-error service target-type))
805 (condition (&ambiguous-target-service-error
807 (target-type target-type))
811 (G_ "more than one target service of type '~a'")
812 (service-type-name target-type))))))))))
814 (fold add-edge edges (service-type-extensions (service-kind service))))
816 (let ((edges (fold add-edges vlist-null services)))
818 (reverse (vhash-foldq* cons '() node edges)))))
820 (define (instantiate-missing-services services)
821 "Return SERVICES, a list, augmented with any services targeted by extensions
822 and missing from SERVICES. Only service types with a default value can be
823 instantiated; other missing services lead to a
824 '&missing-target-service-error'."
825 (define (adjust-service-list svc result instances)
826 (fold2 (lambda (extension result instances)
828 (service-extension-target extension))
830 (match (vhash-assq target-type instances)
832 (let ((default (service-type-default-value target-type)))
833 (if (eq? &no-default-value default)
834 (missing-target-error svc target-type)
835 (let ((new (service target-type)))
836 (values (cons new result)
837 (vhash-consq target-type new instances))))))
839 (values result instances))))
842 (service-type-extensions (service-kind svc))))
844 (let loop ((services services))
846 (fold (lambda (service result)
847 (vhash-consq (service-kind service) service
849 vlist-null services))
852 (fold2 adjust-service-list
856 ;; If we instantiated services, they might in turn depend on missing
857 ;; services. Loop until we've reached fixed point.
858 (if (= (length adjusted) (vlist-length instances))
862 (define* (fold-services services
863 #:key (target-type system-service-type))
864 "Fold SERVICES by propagating their extensions down to the root of type
865 TARGET-TYPE; return the root service adjusted accordingly."
867 (service-back-edges services))
869 (define (matching-extension target)
870 (let ((target (service-kind target)))
872 (($ <service-extension> type)
873 (eq? type target)))))
875 (define (apply-extension target)
877 (match (find (matching-extension target)
878 (service-type-extensions (service-kind service)))
879 (($ <service-extension> _ compute)
880 (compute (service-value service))))))
882 (match (filter (lambda (service)
883 (eq? (service-kind service) target-type))
886 ;; Use the state monad to keep track of already-visited services in the
887 ;; graph and to memoize their value once folded.
889 (let loop ((sink sink))
890 (mlet %state-monad ((visited (current-state)))
891 (match (vhash-assq sink visited)
894 ((dependents (mapm %state-monad loop (dependents sink)))
895 (visited (current-state))
896 (extensions -> (map (apply-extension sink) dependents))
897 (extend -> (service-type-extend (service-kind sink)))
898 (compose -> (service-type-compose (service-kind sink)))
899 (params -> (service-value sink))
902 ;; Distinguish COMPOSE and EXTEND because PARAMS typically
903 ;; has a different type than the elements of EXTENSIONS.
905 (service (service-kind sink)
906 (extend params (compose extensions)))
909 (set-current-state (vhash-consq sink service visited))
911 ((_ . service) ;SINK was already visited
916 (condition (&missing-target-service-error
918 (target-type target-type))
920 (message (format #f (G_ "service of type '~a' not found")
921 (service-type-name target-type)))))))
924 (condition (&ambiguous-target-service-error
926 (target-type target-type))
930 (G_ "more than one target service of type '~a'")
931 (service-type-name target-type)))))))))
933 ;;; services.scm ends here.