From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 04:35:47 2017 Received: (at 28772) by debbugs.gnu.org; 13 Oct 2017 08:35:47 +0000 Received: from localhost ([127.0.0.1]:36826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2vRa-0006fa-Rq for submit@debbugs.gnu.org; Fri, 13 Oct 2017 04:35:47 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:52528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2vRZ-0006fQ-Ml for 28772@debbugs.gnu.org; Fri, 13 Oct 2017 04:35:46 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 2607BA39B; Fri, 13 Oct 2017 10:35:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z83eounSUtV4; Fri, 13 Oct 2017 10:35:45 +0200 (CEST) Received: from ribbon (unknown [193.50.110.214]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DBB68A379; Fri, 13 Oct 2017 10:35:44 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: guix-devel@gnu.org Subject: Re: 02/02: doc: Add an example to the documentation of the udev-service. References: <20171013064322.9299.48232@vcs0.savannah.gnu.org> <20171013064323.9382C20339@vcs0.savannah.gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 =?utf-8?Q?Vend=C3=A9miaire?= an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 13 Oct 2017 10:35:43 +0200 In-Reply-To: <20171013064323.9382C20339@vcs0.savannah.gnu.org> (Ricardo Wurmus's message of "Fri, 13 Oct 2017 02:43:23 -0400 (EDT)") Message-ID: <87r2u7qwbk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 28772 Cc: 28772@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) 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.