unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Thompson <dthompson2@worcester.edu>
Cc: Andy Wingo <wingo@pobox.com>, guix-devel@gnu.org
Subject: Re: [PATCH] Add upower
Date: Sun, 12 Apr 2015 23:01:53 +0200	[thread overview]
Message-ID: <87twwlqcvy.fsf@gnu.org> (raw)
In-Reply-To: <87r3ryfwvi.fsf@fsf.org> (David Thompson's message of "Sun, 05 Apr 2015 10:55:13 -0400")

David Thompson <dthompson2@worcester.edu> skribis:

> Andy Wingo <wingo@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’.

  parent reply	other threads:[~2015-04-12 21:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 19:56 [PATCH] Add upower Andy Wingo
2015-04-05 14:55 ` David Thompson
2015-04-05 20:33   ` Making service values transparent Ludovic Courtès
2015-04-12 21:01   ` Ludovic Courtès [this message]
2015-04-05 15:07 ` [PATCH] Add upower Mark H Weaver
2015-04-12 22:05 ` Ludovic Courtès

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=87twwlqcvy.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=dthompson2@worcester.edu \
    --cc=guix-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).