From 476b333fbcda397557382a0988646b8bd177874d Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Sun, 17 Jan 2021 20:16:05 +0100 Subject: 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 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") -- cgit v1.2.3