@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013-2017, 2019-2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2023 Josselin Poiret <dev@jpoiret.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -354,9 +355,9 @@ (define (session-environment-service vars)
;;; PAM root service.
;;;
-;; A PAM transformer consists of a procedure acting on each PAM entry, with an
-;; additional list of shepherd-requirements that the meta PAM shepherd service
-;; will depend on.
+;; Extension of the PAM configuration. A PAM transformer consists of a
+;; procedure acting on each PAM entry; 'shepherd-requirements' lists services
+;; that the meta 'pam' Shepherd service will depend on.
(define-record-type* <pam-extension>
pam-extension make-pam-extension pam-extension?
(transformer pam-extension-transformer)
@@ -380,12 +381,8 @@ (define (/etc-entry config)
"Return the /etc/pam.d entry corresponding to CONFIG."
(match config
(($ <pam-configuration> services transformers shepherd-requirements)
- (let ((services
- (map
- ;; XXX We need to add identity because compose expects at least
- ;; one argument for some reason.
- (apply compose (cons identity transformers))
- services)))
+ (let ((services (map (apply compose identity transformers)
+ services)))
`(("pam.d" ,(pam-services->directory services)))))))
(define (pam-shepherd-service config)
@@ -404,16 +401,15 @@ (define (extend-configuration initial extensions)
"Extend INITIAL with NEW."
;; TODO: Remove deprecation shim.
(define cleaned-extensions
- (map
- (lambda (ext)
- (cond
- ((procedure? ext)
- (begin
- (warning (G_ "pam-root-service-type transformer extensions should\
-now use the <pam-extension> record."))
- (pam-extension (transformer ext))))
- (#t ext)))
- extensions))
+ (map (lambda (ext)
+ (if (procedure? ext)
+ (begin
+ (warning (G_ "'pam-root-service-type' extensions should \
+now use the <pam-extension> record~%"))
+ (pam-extension (transformer ext)))
+ ext))
+ extensions))
+
(let-values (((services pam-extensions)
(partition pam-service? cleaned-extensions)))
(pam-configuration