From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: 02/02: doc: Add an example to the documentation of the udev-service. Date: Fri, 13 Oct 2017 10:35:43 +0200 Message-ID: <87r2u7qwbk.fsf@gnu.org> References: <20171013064322.9299.48232@vcs0.savannah.gnu.org> <20171013064323.9382C20339@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2vRf-0005DC-Io for guix-devel@gnu.org; Fri, 13 Oct 2017 04:35:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2vRb-0003Yf-34 for guix-devel@gnu.org; Fri, 13 Oct 2017 04:35:51 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:38439) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2vRa-0003Xr-Rr for guix-devel@gnu.org; Fri, 13 Oct 2017 04:35:47 -0400 In-Reply-To: <20171013064323.9382C20339@vcs0.savannah.gnu.org> (Ricardo Wurmus's message of "Fri, 13 Oct 2017 02:43:23 -0400 (EDT)") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: 28772@debbugs.gnu.org, Maxim Cournoyer Hi! rekado@elephly.net (Ricardo Wurmus) skribis: > commit e0c1d080b520c1bbd2dcd7bc90a750f5ce580486 > Author: Ricardo Wurmus > Date: Mon Oct 9 23:03:56 2017 +0200 > > doc: Add an example to the documentation of the udev-service. >=20=20=20=20=20 > * doc/guix.texi (Base Services): Update 'udev-service' documentation. Good idea. > +@example > +(define %example-udev-rule > + (udev-rule "90-usb-thing.rules" > + "ACTION=3D=3D\"add\", SUBSYSTEM=3D=3D\"usb\", ATTR@{product= @}=3D=3D\"Example\", RUN+=3D\"/path/to/script\"")) > + > +(operating-system > + ;; @dots{} > + (services (modify-services %desktop-services > + (udev-service-type config =3D> > + (udev-configuration (inherit config) > + (rules (append (udev-configuration-rules config) > + (list %example-udev-rule)))))))) > +@end example 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 ;; =E2=80=A6 (services (cons (additional-udev-rules %example-udev-rule) %desktop-services))) Thoughts? Ludo=E2=80=99.