From 61ad9bc2adc189f41128874649b115cfaadec48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 27 Nov 2021 18:38:33 +0100 Subject: [PATCH] services: Document the 'delete' clause of 'modify-services'. * doc/guix.texi (Service Reference): Mention the 'delete' clause of 'modify-services'. * gnu/services.scm (modify-services): Likewise in docstring. --- doc/guix.texi | 9 +++++++++ gnu/services.scm | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1bb139e9b0a12b139ce06bf5e3613d944114c38d..59651f996b6d1f05888ba53ee3570c130452016e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35724,6 +35724,15 @@ are created using @code{define-record-type*}, you can write a succinct @var{body} that evaluates to the new service parameters by using the @code{inherit} feature that @code{define-record-type*} provides. +Clauses can also have the following form: + +@lisp +(delete @var{type}) +@end lisp + +Such a clause removes all services of the given @var{type} from +@var{services}. + @xref{Using the Configuration System}, for example usage. @end deffn diff --git a/gnu/services.scm b/gnu/services.scm index 1655218f2d14cd7dbc477eb5da27a04c67288034..68fa4ebb63e8fab223fc01379195e9920455d8bb 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -319,7 +319,13 @@ the resulting list of services. Each clause must have the form: where TYPE is a service type, such as 'guix-service-type', and VARIABLE is an identifier that is bound within BODY to the value of the service of that -TYPE. Consider this example: +TYPE. + +Clauses can also remove services of a given type: + + (delete TYPE) + +Consider this example: (modify-services %base-services (guix-service-type config =>