[Top][All Lists]

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

09/13: system: pam: Use 'computed-file' instead of 'gexp->derivation'.

From: Ludovic Courtès
Subject: 09/13: system: pam: Use 'computed-file' instead of 'gexp->derivation'.
Date: Wed, 23 Sep 2015 20:55:17 +0000

civodul pushed a commit to branch wip-service-refactor
in repository guix.

commit 1b567846e039b9650c59df5830a14a14e9451e27
Author: Ludovic Courtès <address@hidden>
Date:   Thu Sep 17 23:28:59 2015 +0200

    system: pam: Use 'computed-file' instead of 'gexp->derivation'.
    * gnu/system/linux.scm (pam-service->configuration): Use 'computed-file'
      instead of 'gexp->derivation'.
      (pam-services->directory): Likewise.
    * gnu/system.scm (etc-directory): Adjust accordingly.
 gnu/system.scm       |    2 +-
 gnu/system/linux.scm |   15 ++++-----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 92a3ca3..cb0ee90 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -447,7 +447,7 @@ on SHELLS.  /etc/shells is used by xterm, polkit, and other 
                         (sudoers-file (plain-file "sudoers" "")))
   "Return a derivation that builds the static part of the /etc directory."
   (mlet* %store-monad
-      ((pam.d      (pam-services->directory pam-services))
+      ((pam.d ->   (pam-services->directory pam-services))
        (login.defs (text-file "login.defs" "# Empty for now.\n"))
        (shells     (shells-file shells))
        (emacs      (emacs-site-directory))
diff --git a/gnu/system/linux.scm b/gnu/system/linux.scm
index ac5005e..10e72e9 100644
--- a/gnu/system/linux.scm
+++ b/gnu/system/linux.scm
@@ -17,10 +17,8 @@
 ;;; along with GNU Guix.  If not, see <>.
 (define-module (gnu system linux)
-  #:use-module (guix store)
   #:use-module (guix records)
   #:use-module (guix derivations)
-  #:use-module (guix monads)
   #:use-module (guix gexp)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
@@ -86,18 +84,13 @@ dumped in /etc/pam.d/NAME, where NAME is the name of 
                           (map (cut entry->gexp "session" <>) session))
-     (gexp->derivation name builder))))
+     (computed-file name builder))))
 (define (pam-services->directory services)
   "Return the derivation to build the configuration directory to be used as
 /etc/pam.d for SERVICES."
-  (mlet %store-monad
-      ((names -> (map pam-service-name services))
-       (files (sequence %store-monad
-                        (map pam-service->configuration
-                             ;; XXX: Eventually, SERVICES may be a list of
-                             ;; monadic values instead of plain values.
-                             services))))
+  (let ((names (map pam-service-name services))
+        (files (map pam-service->configuration services)))
     (define builder
           (use-modules (ice-9 match)
@@ -114,7 +107,7 @@ dumped in /etc/pam.d/NAME, where NAME is the name of 
                     ;; instead.  See <>.
                     (delete-duplicates '#$(zip names files)))))
-    (gexp->derivation "pam.d" builder)))
+    (computed-file "pam.d" builder)))
 (define %pam-other-services
   ;; The "other" PAM configuration, which denies everything (see

reply via email to

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