Ricardo Wurmus <[email protected]> skribis: > Ludovic Courtès <[email protected]> writes: > >> We should factorize this so one can write: >> >> (udev-rule "90-avrispmkii.rules" >> "SUBSYSTEM != …") >> >> Because here it’s arguably sufficiently verbose to discourage newcomers. >> :-) > > Patch attached. Is this okay? > > From 77f22cb933a9740cccc62f6bac2d3f9381192eba Mon Sep 17 00:00:00 2001 > From: Ricardo Wurmus <[email protected]> > Date: Wed, 18 Nov 2015 21:58:53 +0100 > Subject: [PATCH] services: Add udev-rule procedure. > > * gnu/services/base.scm (udev-rule): New procedure. > (kvm-udev-rule): Rewrite in terms of udev-rule.
[...] > +(define (udev-rule filename contents) > + "Return a directory with a udev rule file FILENAME containing CONTENTS." Rather “file-name” (sorry for being pedantic ;-)). > +(define (kvm-udev-rule) This can even become a plain variable. Otherwise LGTM! > > That’s one way do do it. > > > > Another one would be to write an avrispmkii service that would extend > > ‘udev-service-type’ by passing it its rule (and maybe it could do other > > useful things as well?) > > I did this first but then it seemed overly complicated when there > already is a service that does almost exactly what I want. Yeah, makes sense! Thank you, Ludo’.
