services: Streamline or eliminate some match-lambda patterns.

These were spot while working on a fix for commit 543d971ed2 ("services:
configuration: Re-order generated record fields").

* gnu/services/web.scm (php-fpm-accounts): Remove extraneous trailing dummy
catchall patterns.
(agate-accounts): Access the configuration fields directly since there are
only two, which is less error-prone.
This commit is contained in:
Maxim Cournoyer 2022-11-16 23:14:48 -05:00
parent 238248aac9
commit 7ae4cfa5aa
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -987,7 +987,7 @@ (define-record-type* <php-fpm-on-demand-process-manager-configuration>
(define php-fpm-accounts (define php-fpm-accounts
(match-lambda (match-lambda
(($ <php-fpm-configuration> php socket user group socket-user socket-group _ _ _ _ _ _) (($ <php-fpm-configuration> php socket user group socket-user socket-group)
`(,@(if (equal? group "php-fpm") `(,@(if (equal? group "php-fpm")
'() '()
(list (user-group (name "php-fpm") (system? #t)))) (list (user-group (name "php-fpm") (system? #t))))
@ -2143,24 +2143,23 @@ (define agate-shepherd-service
(stop #~(make-kill-destructor))))))) (stop #~(make-kill-destructor)))))))
(define agate-accounts (define agate-accounts
(match-lambda (lambda (config)
(($ <agate-configuration> _ _ _ _ _ (let ((group (agate-configuration-group config))
_ _ _ _ (user (agate-configuration-user config)))
_ user group _) `(,@(if (equal? group "agate")
`(,@(if (equal? group "agate") '()
'() (list (user-group (name "agate") (system? #t))))
(list (user-group (name "agate") (system? #t)))) ,(user-group
,(user-group (name group)
(name group) (system? #t))
(system? #t)) ,(user-account
,(user-account (name user)
(name user) (group group)
(group group) (supplementary-groups '("agate"))
(supplementary-groups '("agate")) (system? #t)
(system? #t) (comment "agate server user")
(comment "agate server user") (home-directory "/var/empty")
(home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin")))))))
(shell (file-append shadow "/sbin/nologin")))))))
(define agate-service-type (define agate-service-type
(service-type (service-type