Subject: Re: [bug#28647] [PATCH] services: base: Add file->udev-rule function.

From: [email-masked] (Ludovic Courtès)
Date: Tue, 03 Oct 2017 15:18:49 +0200

Hi Maxim,

Maxim Cournoyer <[email-masked]> skribis:

> While experimenting with udev rules, I found a need to be able to pass
> file-like objects containing udev rules to the udev-service. This patch
> implements a `file->udev-rule' method that does just that.

Looks useful!

> From 050e96b3325f851f3118de0c881d25796d76049b Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <[email-masked]>
> Date: Wed, 27 Sep 2017 21:33:25 -0400
> Subject: [PATCH] services: base: Add file->udev-rule function.
>
> This function allows passing a file-like object to the udev service.
>
> * gnu/services/base.scm (file->udev-rule): New function.
> * doc/guix.texi (Base Services): Document it.

[...]

> -@deffn {Scheme Procedure} udev-service [#:udev udev]
> +@deffn {Scheme Procedure} udev-service [#:udev @var{eudev} #:rules @code{'()}]
>  Run @var{udev}, which populates the @file{/dev} directory dynamically.
> +Packages can be included in the @var{rules} list in order to extend the
> +udev rules with the definitions found under their
> +@file{lib/udev/rules.d} sub-directory.
> +
> +The functions @code{udev-rules} and @code{file->udev-rules} from
> +@code{(gnu services base)} can be used to create rule objects based on a
> +string or a file-like object, respectively. Those rule objects can be
> +passed to udev-service just like packages.

Could you document the procedures with @deffn so that they have an entry
in the index?

  @deffn {Scheme Procedure} udev-rules @var{rules}
  …
  @end deffn

  @deffn {Scheme Procedure} file->udev-rules @var{files}
  Similar to @code{udev-rules}, but…
  @end deffn

TIA!

Ludo’.