summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorLeo Prikler <leo.prikler@student.tugraz.at>2021-01-17 20:16:05 +0100
committerLeo Prikler <leo.prikler@student.tugraz.at>2021-01-17 20:16:05 +0100
commit476b333fbcda397557382a0988646b8bd177874d (patch)
tree979e86ffff4d41c5898f02ef8afa6e2934027c2a /gnu/services
parentb57056a9fd83c61efb5343853948a798da6e975e (diff)
services: cups: reuse lp from %base-groups.
* gnu/services/cups.scm (%cups-accounts): Try to reuse lp from %base-groups.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/cups.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm
index f10615e59e..17ed04e58b 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")