summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-12-01 23:07:11 +0100
committerLudovic Courtès <ludo@gnu.org>2014-12-02 16:51:43 +0100
commitcc7fa5929c26fcdd53ce83ce7a46de4dfc7af1a2 (patch)
treea85d2d26d79c652391f4fa44e9c7dc56e365f77b
parentf4c4513d478df5b22c7bae53b876dbd7b9cf5639 (diff)
downloadguix-cc7fa5929c26fcdd53ce83ce7a46de4dfc7af1a2.tar.gz
guix system: Use 'mbegin' for 'install'.
* guix/scripts/system.scm (install): Use 'mbegin'.  Lift FORMAT and
  POPULATE-ROOT-FILE-SYSTEM, and use the result.
-rw-r--r--guix/scripts/system.scm28
1 files changed, 16 insertions, 12 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 8ea77e4f3c..8e049a4f45 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -151,18 +151,22 @@ When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG."
             ;; Copy items to the new store.
             (copy-closure to-copy target #:log-port log-port)))))
 
-  (mlet* %store-monad ((os-dir -> (derivation->output-path os-drv))
-                       (%         (maybe-copy os-dir)))
-
-    ;; Create a bunch of additional files.
-    (format log-port "populating '~a'...~%" target)
-    (populate-root-file-system os-dir target)
-
-    (when grub?
-      (unless (false-if-exception (install-grub grub.cfg device target))
-        (leave (_ "failed to install GRUB on device '~a'~%") device)))
-
-    (return #t)))
+  (let ((os-dir   (derivation->output-path os-drv))
+        (format   (lift %store-monad format))
+        (populate (lift2 %store-monad populate-root-file-system)))
+
+    (mbegin %store-monad
+      (maybe-copy os-dir)
+
+      ;; Create a bunch of additional files.
+      (format log-port "populating '~a'...~%" target)
+      (populate os-dir target)
+
+      (begin
+        (when grub?
+          (unless (false-if-exception (install-grub grub.cfg device target))
+            (leave (_ "failed to install GRUB on device '~a'~%") device)))
+        (return #t)))))
 
 
 ;;;