From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] Export udev-configuration functions. Date: Wed, 18 Nov 2015 12:30:38 +0100 Message-ID: <874mgjk0ip.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz14K-00072P-Nj for guix-devel@gnu.org; Wed, 18 Nov 2015 06:38:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz14H-0004LH-Gx for guix-devel@gnu.org; Wed, 18 Nov 2015 06:38:32 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:24426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz14H-0004K8-7n for guix-devel@gnu.org; Wed, 18 Nov 2015 06:38:29 -0500 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Guix, as I tried to add a custom udev rule I noticed that I could only really do this when the udev-configuration accessor functions are exported. In my system configuration I first created the new udev rule (that’s all a bit verbose, unfortunately), which is almost identical to the ‘kvm-udev-rule’: ~~~~~~~~~~~~~~~~ (define (avrispmkii-udev-rule) "Return a directory with a udev rule that sets the group owner and group write permissions on the node matching the AVRISPmkII microcontroller programming device." (computed-file "avrispmkii-rules" #~(begin (use-modules (guix build utils)) (define rules.d (string-append #$output "/lib/udev/rules.d")) (mkdir-p rules.d) (call-with-output-file (string-append rules.d "/90-avrispmkii.rules") (lambda (port) (display "\ SUBSYSTEM!=\"usb\", ACTION!=\"add\", GOTO=\"avrisp_end\" # Atmel Corp. JTAG ICE mkII ATTR{idVendor}==\"03eb\", ATTR{idProduct}==\"2103\", MODE=\"660\", GROUP=\"dialout\" # Atmel Corp. AVRISP mkII ATTR{idVendor}==\"03eb\", ATTR{idProduct}==\"2104\", MODE=\"660\", GROUP=\"dialout\" # Atmel Corp. Dragon ATTR{idVendor}==\"03eb\", ATTR{idProduct}==\"2107\", MODE=\"660\", GROUP=\"dialout\" LABEL=\"avrisp_end\"\n" port)))) #:modules '((guix build utils)))) ~~~~~~~~~~~~~~~~ Then I replaced %desktop-services to amend the service of ‘udev-service-type’: ~~~~~~~~~~~~~~~~ (modify-services %desktop-services (udev-service-type config => (udev-configuration (inherit config) (rules (append (udev-configuration-rules config) (list (avrispmkii-udev-rule))))))) ~~~~~~~~~~~~~~~~ As you can see I need ‘udev-configuration’ to create a new configuration, and ‘udev-configuration-rules’ to append my new rule to the existing rules. The attached patch just exports ‘udev-configuration’, ‘udev-configuration?’ (why not?), and ‘udev-configuration-rules’. ~~ Ricardo --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-services-Export-udev-configuration-procedures.patch >From 46091d6045443a1bedbd1ca37e8ac31c1399d551 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 18 Nov 2015 12:17:42 +0100 Subject: [PATCH] services: Export udev-configuration procedures. * gnu/services/base.scm (udev-configuration, udev-configuration?, udev-configuration-rules): Export. --- gnu/services/base.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index b2bf7d9..bb5854d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -51,6 +51,10 @@ host-name-service console-keymap-service console-font-service + + udev-configuration + udev-configuration? + udev-configuration-rules udev-service-type udev-service -- 2.5.0 --=-=-=--