[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: doc: Add an example to the documentation of the udev-service.
From: |
Ricardo Wurmus |
Subject: |
02/02: doc: Add an example to the documentation of the udev-service. |
Date: |
Fri, 13 Oct 2017 02:43:23 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit e0c1d080b520c1bbd2dcd7bc90a750f5ce580486
Author: Ricardo Wurmus <address@hidden>
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.
---
doc/guix.texi | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6018198..b7f4f88 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9790,8 +9790,32 @@ Return a service that runs the Guix build daemon
according to
@var{config}.
@end deffn
address@hidden {Scheme Procedure} udev-service [#:udev udev]
address@hidden udev-service
address@hidden udev-rule
address@hidden {Scheme Procedure} udev-service [#:udev @var{udev}] [#:rules
@var{'()}]
Run @var{udev}, which populates the @file{/dev} directory dynamically.
+Additional udev rules can be provided as a list of files through the
address@hidden variable. The procedure @var{udev-rule} simplifies the
+creation of these rule files.
+
+In the following example, a rule for a USB device is defined to be
+stored in the file @file{90-usb-thing.rules}, and the default
address@hidden is extended with it. The rule runs a script upon
+detecting a USB device with a given product identifier.
+
address@hidden
+(define %example-udev-rule
+ (udev-rule "90-usb-thing.rules"
+ "ACTION==\"add\", SUBSYSTEM==\"usb\",
address@hidden@}==\"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))))))))
address@hidden example
@end deffn
@deffn {Scheme Procedure} urandom-seed-service @var{#f}