services: cups: reuse lp from %base-groups.

* gnu/services/cups.scm (%cups-accounts): Try to reuse lp from %base-groups.
This commit is contained in:
Leo Prikler 2021-01-17 20:16:05 +01:00
parent b57056a9fd
commit 476b333fbc
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -32,7 +32,7 @@ (define-module (gnu services cups)
#: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 @@ (define-module (gnu services cups)
;;; 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")