guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: services: Streamline or eliminate some match-lambda patterns.


From: guix-commits
Subject: 03/03: services: Streamline or eliminate some match-lambda patterns.
Date: Thu, 17 Nov 2022 06:53:01 -0500 (EST)

apteryx pushed a commit to branch master
in repository guix.

commit 7ae4cfa5aa5b48afc454c392055231a953f5b6c4
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Wed Nov 16 23:14:48 2022 -0500

    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.
---
 gnu/services/web.scm | 37 ++++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 2023119037..f337c90077 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -987,7 +987,7 @@ and the back-end of a Web service.")))
 
 (define php-fpm-accounts
   (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")
              '()
              (list (user-group (name "php-fpm") (system? #t))))
@@ -2143,24 +2143,23 @@ root=/srv/gemini
             (stop #~(make-kill-destructor)))))))
 
 (define agate-accounts
-  (match-lambda
-    (($ <agate-configuration> _ _ _ _ _
-                              _ _ _ _
-                              _ user group _)
-     `(,@(if (equal? group "agate")
-             '()
-             (list (user-group (name "agate") (system? #t))))
-       ,(user-group
-         (name group)
-         (system? #t))
-       ,(user-account
-         (name user)
-         (group group)
-         (supplementary-groups '("agate"))
-         (system? #t)
-         (comment "agate server user")
-         (home-directory "/var/empty")
-         (shell (file-append shadow "/sbin/nologin")))))))
+  (lambda (config)
+    (let ((group (agate-configuration-group config))
+          (user (agate-configuration-user config)))
+      `(,@(if (equal? group "agate")
+              '()
+              (list (user-group (name "agate") (system? #t))))
+        ,(user-group
+          (name group)
+          (system? #t))
+        ,(user-account
+          (name user)
+          (group group)
+          (supplementary-groups '("agate"))
+          (system? #t)
+          (comment "agate server user")
+          (home-directory "/var/empty")
+          (shell (file-append shadow "/sbin/nologin")))))))
 
 (define agate-service-type
   (service-type



reply via email to

[Prev in Thread] Current Thread [Next in Thread]