help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: removing items from %desktop-services


From: Ludovic Courtès
Subject: Re: removing items from %desktop-services
Date: Thu, 17 May 2018 16:28:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Efraim Flashner <address@hidden> 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]