diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 8ea77e4f3c58c59f231abbb45e3ce71d88d97f21..8e049a4f45f52183243394c67800ca7f63daafe7 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -151,18 +151,22 @@ (define (maybe-copy to-copy) ;; 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))))) ;;;