guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add upower


From: Ludovic Courtès
Subject: Re: [PATCH] Add upower
Date: Sun, 12 Apr 2015 23:01:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

David Thompson <address@hidden> skribis:

> Andy Wingo <address@hidden> writes:
>
>> Two patches attached.
>>
>> Unfortunately to use this you need to expand out %base-services to add
>> upower to the udev-service form.  Also you need the upower-service,
>> obviously, and upower needs to be added to the dbus-service form as
>> well.
>
> This isn't the first time I've seen people expanding out %base-services,
> and I was also planning to do so for my OS config.  I wonder if we
> should create a 'make-base-services' procedure that accomodates the
> common tweaks to the %base-services list: the MOTD, the list of packages
> for dbus-service, etc.

In commit 4c9050c, I documented a trick to handle the situation where we
want to customize ‘nscd-service’ as an example:

     As an example, the declaration below configures the NSS to use the
  ‘nss-mdns’ back-end (http://0pointer.de/lennart/projects/nss-mdns/),
  which supports host name lookups over multicast DNS (mDNS) for host
  names ending in ‘.local’:

  [...]

     Note that, in this case, in addition to setting the
  ‘name-service-switch’ of the ‘operating-system’ declaration,
  ‘nscd-service’ must be told where to find the ‘nss-mdns’ shared library
  (*note ‘nscd-service’: Base Services.).  Since the ‘nscd’ service is
  part of %BASE-SERVICES, you may want to customize it by adding this
  snippet in the operating system configuration file:

       (use-modules (guix) (gnu))

       (define %my-base-services
         ;; Replace the default nscd service with one that knows
         ;; about nss-mdns.
         (map (lambda (mservice)
                ;; "Bind" the MSERVICE monadic value to inspect it.
                (mlet %store-monad ((service mservice))
                  (if (member 'nscd (service-provision service))
                      (nscd-service (nscd-configuration)
                                    #:name-services (list nss-mdns))
                      mservice)))
              %base-services))

  … and then refer to %MY-BASE-SERVICES instead of %BASE-SERVICES in the
  ‘operating-system’ declaration.

Not ideal, but that’s what we can do for now.

Ludo’.



reply via email to

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