From: ludo@gnu.org (Ludovic Courtès)
To: guix-devel@gnu.org
Cc: 28772@debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: bug#28772: 02/02: doc: Add an example to the documentation of the udev-service.
Date: Fri, 13 Oct 2017 10:35:43 +0200 [thread overview]
Message-ID: <87r2u7qwbk.fsf__24415.0455961519$1507883952$gmane$org@gnu.org> (raw)
In-Reply-To: <20171013064323.9382C20339@vcs0.savannah.gnu.org> (Ricardo Wurmus's message of "Fri, 13 Oct 2017 02:43:23 -0400 (EDT)")
Hi!
rekado@elephly.net (Ricardo Wurmus) skribis:
> commit e0c1d080b520c1bbd2dcd7bc90a750f5ce580486
> Author: Ricardo Wurmus <rekado@elephly.net>
> Date: Mon Oct 9 23:03:56 2017 +0200
>
> doc: Add an example to the documentation of the udev-service.
>
> * doc/guix.texi (Base Services): Update 'udev-service' documentation.
Good idea.
> +@example
> +(define %example-udev-rule
> + (udev-rule "90-usb-thing.rules"
> + "ACTION==\"add\", SUBSYSTEM==\"usb\", ATTR@{product@}==\"Example\", RUN+=\"/path/to/script\""))
> +
> +(operating-system
> + ;; @dots{}
> + (services (modify-services %desktop-services
> + (udev-service-type config =>
> + (udev-configuration (inherit config)
> + (rules (append (udev-configuration-rules config)
> + (list %example-udev-rule))))))))
> +@end example
<https://bugs.gnu.org/28647> is somewhat related.
Fundamentally though, to simplify this use case, we should have:
(define (additional-udev-rules . rules)
"Add RULES, a list of file-like object, as a udev rules."
(simple-service 'udev-rule udev-service-type rules))
so one can write:
(operating-system
;; …
(services (cons (additional-udev-rules %example-udev-rule)
%desktop-services)))
Thoughts?
Ludo’.
prev parent reply other threads:[~2017-10-13 8:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171013064322.9299.48232@vcs0.savannah.gnu.org>
[not found] ` <20171013064323.9382C20339@vcs0.savannah.gnu.org>
2017-10-13 8:35 ` 02/02: doc: Add an example to the documentation of the udev-service Ludovic Courtès
2017-10-13 8:35 ` Ludovic Courtès [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='87r2u7qwbk.fsf__24415.0455961519$1507883952$gmane$org@gnu.org' \
--to=ludo@gnu.org \
--cc=28772@debbugs.gnu.org \
--cc=guix-devel@gnu.org \
--cc=maxim.cournoyer@gmail.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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.