diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-09-19 13:31:06 +0900 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-09-19 23:11:19 +0900 |
commit | 71654dfdda4890d7a663a36a7fe754b53591aba6 (patch) | |
tree | fda1be459091f59487413a53b791bdd68cbb46c8 /doc | |
parent | bf307a7a54eeca405e5c6ad50a9cbe6b9e10190d (diff) | |
download | guix-71654dfdda4890d7a663a36a7fe754b53591aba6.tar guix-71654dfdda4890d7a663a36a7fe754b53591aba6.tar.gz |
services: Add 'simple-service'.
* gnu/services.scm (simple-service): New procedure.
* doc/guix.texi (Service Reference): Document it.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guix.texi | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 7a86a2f0ac..808fbdceb4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11348,6 +11348,25 @@ the extension; it must return a valid value for the target service. Return true if @var{obj} is a service extension. @end deffn +Occasionally, you might want to simply extend an existing service. This +involves creating a new service type and specifying the extension of +interest, which can be verbose; the @code{simple-service} procedure +provides a shorthand for this. + +@deffn {Scheme Procedure} simple-service @var{name} @var{target} @var{value} +Return a service that extends @var{target} with @var{value}. This works +by creating a singleton service type @var{name}, of which the returned +service is an instance. + +For example, this extends mcron (@pxref{Scheduled Job Execution}) with +an additional job: + +@example +(simple-service 'my-mcron-job mcron-service-type + #~(job '(next-hour (3)) "guix gc -F 2G")) +@end example +@end deffn + At the core of the service abstraction lies the @code{fold-services} procedure, which is responsible for ``compiling'' a list of services down to a single directory that contains everything needed to boot and |