[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: services: cups: reuse lp from %base-groups.
From: |
guix-commits |
Subject: |
01/02: services: cups: reuse lp from %base-groups. |
Date: |
Sun, 17 Jan 2021 14:42:00 -0500 (EST) |
leoprikler pushed a commit to branch master
in repository guix.
commit 476b333fbcda397557382a0988646b8bd177874d
Author: Leo Prikler <leo.prikler@student.tugraz.at>
AuthorDate: Sun Jan 17 20:16:05 2021 +0100
services: cups: reuse lp from %base-groups.
* gnu/services/cups.scm (%cups-accounts): Try to reuse lp from %base-groups.
---
gnu/services/cups.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm
index f10615e..17ed04e 100644
--- a/gnu/services/cups.scm
+++ b/gnu/services/cups.scm
@@ -32,7 +32,7 @@
#:use-module (guix records)
#:use-module (guix gexp)
#:use-module (ice-9 match)
- #:use-module ((srfi srfi-1) #:select (append-map))
+ #:use-module ((srfi srfi-1) #:select (append-map find))
#:export (cups-service-type
cups-configuration
opaque-cups-configuration
@@ -50,7 +50,13 @@
;;; Code:
(define %cups-accounts
- (list (user-group (name "lp") (system? #t))
+ (list (or
+ ;; The "lp" group should already exist; try to reuse it.
+ (find (lambda (group)
+ (and (user-group? group)
+ (string=? (user-group-name group) "lp")))
+ %base-groups)
+ (user-group (name "lp") (system? #t)))
(user-group (name "lpadmin") (system? #t))
(user-account
(name "lp")