all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#28772: 02/02: doc: Add an example to the documentation of the udev-service.
       [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
  1 sibling, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-10-13  8:35 UTC (permalink / raw)
  To: guix-devel; +Cc: 28772, Maxim Cournoyer

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 02/02: doc: Add an example to the documentation of the udev-service.
       [not found] ` <20171013064323.9382C20339@vcs0.savannah.gnu.org>
@ 2017-10-13  8:35   ` Ludovic Courtès
  2017-10-13  8:35   ` bug#28772: " Ludovic Courtès
  1 sibling, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-10-13  8:35 UTC (permalink / raw)
  To: guix-devel; +Cc: 28772, Maxim Cournoyer

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-13  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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   ` bug#28772: " Ludovic Courtès

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.