From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] Add upower Date: Sun, 12 Apr 2015 23:01:53 +0200 Message-ID: <87twwlqcvy.fsf@gnu.org> References: <87egnz4qgt.fsf@pobox.com> <87r3ryfwvi.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhP0x-0007ed-88 for guix-devel@gnu.org; Sun, 12 Apr 2015 17:02:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhP0t-0002WR-V6 for guix-devel@gnu.org; Sun, 12 Apr 2015 17:01:59 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhP0t-0002WN-Rq for guix-devel@gnu.org; Sun, 12 Apr 2015 17:01:55 -0400 In-Reply-To: <87r3ryfwvi.fsf@fsf.org> (David Thompson's message of "Sun, 05 Apr 2015 10:55:13 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: Andy Wingo , guix-devel@gnu.org David Thompson skribis: > Andy Wingo 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 =E2=80=98nscd-service=E2=80=99 as an example: As an example, the declaration below configures the NSS to use the =E2=80=98nss-mdns=E2=80=99 back-end (http://0pointer.de/lennart/projects/= nss-mdns/), which supports host name lookups over multicast DNS (mDNS) for host names ending in =E2=80=98.local=E2=80=99: [...] Note that, in this case, in addition to setting the =E2=80=98name-service-switch=E2=80=99 of the =E2=80=98operating-system=E2= =80=99 declaration, =E2=80=98nscd-service=E2=80=99 must be told where to find the =E2=80=98ns= s-mdns=E2=80=99 shared library (*note =E2=80=98nscd-service=E2=80=99: Base Services.). Since the =E2=80= =98nscd=E2=80=99 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)) =E2=80=A6 and then refer to %MY-BASE-SERVICES instead of %BASE-SERVICES i= n the =E2=80=98operating-system=E2=80=99 declaration. Not ideal, but that=E2=80=99s what we can do for now. Ludo=E2=80=99.