David Thompson <dthomps...@worcester.edu> skribis: > Andy Wingo <wi...@pobox.com> 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’.