From: ludo@gnu.org (Ludovic Courtès)
To: Efraim Flashner <efraim@flashner.co.il>
Cc: help-guix@gnu.org
Subject: Re: removing items from %desktop-services
Date: Thu, 17 May 2018 16:28:18 +0200 [thread overview]
Message-ID: <87y3gixsot.fsf@gnu.org> (raw)
In-Reply-To: <20180516084452.GB1239@macbook41> (Efraim Flashner's message of "Wed, 16 May 2018 11:44:52 +0300")
Hello,
Efraim Flashner <efraim@flashner.co.il> skribis:
> I'm trying to modify the list of services in my os-config, and I've run
> into a bit of a problem. I've replaced my ntp-service with an
> openntpd-service, but I'm having trouble with the syntax for removing
> more services. Here's a snippet:
There’s an example of that in the manual (info "(guix) Using the
Configuration System"):
(remove (lambda (service)
(eq? (service-kind service) avahi-service-type))
%desktop-services)
I suppose you could do the same for ntpd.
Now it’s a bit more verbose. In the snippets you posted you used
‘delete’, but that’ll only work if the service you want to remove has
the default configuration (and assuming it can be usefully compared with
‘equal?’), so the more verbose ‘remove’ stanza is needed.
Now, just like we have ‘modify-services’, we could have
‘remove-services’ or similar, like this:
(define (remove-services types services)
(remove (lambda (service)
(any (lambda (type)
(eq? (service-kind service) type))
types))
services))
and then you could write:
;; Remove NTP and Avahi.
(remove-services (list avahi-service-type ntp-service-type)
%desktop-services)
HTH!
Ludo’.
prev parent reply other threads:[~2018-05-17 14:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 8:44 removing items from %desktop-services Efraim Flashner
2018-05-17 14:28 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3gixsot.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=efraim@flashner.co.il \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).