GNU bug report logs - #40453
[PATCH] services: add perpipherals

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Sun, 5 Apr 2020 19:49:01 UTC

Severity: normal

Tags: patch

Done: Brice Waegeneire <brice <at> waegenei.re>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40453 in the body.
You can then email your comments to 40453 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#40453; Package guix-patches. (Sun, 05 Apr 2020 19:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 05 Apr 2020 19:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: add perpipherals
Date: Sun,  5 Apr 2020 21:48:32 +0200
---
 Makefile                         |  1 +
 modules/config/base.scm          |  4 +---
 modules/config/workstation.scm   |  4 ++--
 modules/services/peripherals.scm | 30 ++++++++++++++++++++++++++++++
 4 files changed, 34 insertions(+), 5 deletions(-)
 create mode 100644 modules/services/peripherals.scm

diff --git a/Makefile b/Makefile
index 9242659..9941cf6 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ MODULES =                               								\
 	$(MODULES_DIR)/config/base.scm                          			\
 	$(MODULES_DIR)/config/workstation.scm                         		\
 	$(MODULES_DIR)/services/kernel-modules.scm                          \
+	$(MODULES_DIR)/services/peripherals.scm                             \
 	$(MODULES_DIR)/utils.scm
 
 SCM_FILES = $(MODULES) $(MISC_SCM_FILES)
diff --git a/modules/config/base.scm b/modules/config/base.scm
index acc76e9..ef80130 100644
--- a/modules/config/base.scm
+++ b/modules/config/base.scm
@@ -75,16 +75,14 @@
                  (supplementary-groups
                   '("wheel" "netdev" "audio" "video"
                     "lp" ; for bluetooth tether
-                    "plugdev" ; TODO extract it to u2f service
+                    "plugdev" ; u2f
                     "input"   ; for brightness control through brightnessctl
                     "adbusers"
                     "kvm" "libvirt"
                     )))
                 %base-user-accounts))
 
-   ;; TODO extract it to u2f service
    (groups (append (list
-                    (user-group (name "plugdev") (system? #t))
                     (user-group (name "adbusers") (system? #t)))
                    %base-groups))
 
diff --git a/modules/config/workstation.scm b/modules/config/workstation.scm
index 2ce09df..a965fbd 100644
--- a/modules/config/workstation.scm
+++ b/modules/config/workstation.scm
@@ -20,6 +20,7 @@
   #:use-module (config base)
   #:use-module (utils)
   #:use-module (services kernel-modules)
+  #:use-module (services peripherals)
   #:use-module (srfi srfi-1)
   #:export (workstation-os
             workstation-packages
@@ -48,8 +49,7 @@
    (service gpm-service-type)           ; Mouse on console
    (service pcscd-service-type)
    (load-kernel-modules-service '("ddcci" "ddcci_backlight"))
-   ;; TODO replace the following line with (service u2f-service-type)
-   (simple-service 'u2f-udev udev-service-type (list libu2f-host))
+   (service u2f-service-type)
    (simple-service 'android-udev udev-service-type (list android-udev-rules))
    (simple-service 'backlight-udev udev-service-type (list brightnessctl))))
 
diff --git a/modules/services/peripherals.scm b/modules/services/peripherals.scm
new file mode 100644
index 0000000..6d2d484
--- /dev/null
+++ b/modules/services/peripherals.scm
@@ -0,0 +1,30 @@
+(define-module (services peripherals)
+  #:use-module (gnu services)
+  #:use-module (gnu services base)
+  #:use-module (gnu services configuration)
+  #:use-module (gnu system accounts)
+  #:use-module (gnu system shadow)
+  #:use-module (gnu packages security-token)
+  #:use-module (guix packages)
+  #:export (u2f-service-type))
+
+(define-configuration u2f-configuration
+  (u2f    (package libu2f-host)
+          "The u2f package"))
+
+(define (u2f-udev-service config)
+  (list (u2f-configuration-u2f config)))
+
+(define u2f-accounts
+  (const (list (user-group (name "plugdev") (system? #t)))))
+
+(define u2f-service-type
+  (service-type (name 'u2f)
+                (extensions
+                 (list (service-extension udev-service-type
+                                          u2f-udev-service)
+                       (service-extension account-service-type
+                                          u2f-accounts)))
+                (default-value (u2f-configuration))
+                (description
+                 "Give access to u2f tokens for plugdev members.")))
-- 
2.26.0





bug closed, send any further explanations to 40453 <at> debbugs.gnu.org and Brice Waegeneire <brice <at> waegenei.re> Request was from Brice Waegeneire <brice <at> waegenei.re> to control <at> debbugs.gnu.org. (Sun, 05 Apr 2020 19:52:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#40453; Package guix-patches. (Mon, 06 Apr 2020 14:53:01 GMT) Full text and rfc822 format available.

Message #10 received at 40453 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40453 <at> debbugs.gnu.org
Subject: Re: [bug#40453] [PATCH] services: add perpipherals
Date: Mon, 6 Apr 2020 10:52:00 -0400 (EDT)
On Sun, 5 Apr 2020, Brice Waegeneire wrote:

> ---
> Makefile                         |  1 +
> modules/config/base.scm          |  4 +---
> modules/config/workstation.scm   |  4 ++--
> modules/services/peripherals.scm | 30 ++++++++++++++++++++++++++++++
> 4 files changed, 34 insertions(+), 5 deletions(-)
> create mode 100644 modules/services/peripherals.scm

I don't have any comments on the contents of the patch, but wanted to ask 
that this change be mentioned in etc/news.scm so that folks can update 
their operating system definitions.

Thanks!
Jack




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 May 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.