From 033adfe7e0ed37f42098772549414a1dc797605c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 9 Dec 2013 21:32:36 +0100 Subject: gnu: Add (gnu system). * gnu/system/vm.scm (lower-inputs): Move to monads.scm. (qemu-image): Don't add GRUB-CONFIGURATION to the INPUTS-TO-COPY. (union, file-union, etc-directory): Move to gnu/system.scm. (%demo-operating-system): New variable. (system-qemu-image): Add 'os' parameter. Rewrite in terms of 'operating-system-derivation'. * guix/monads.scm (lower-inputs): New procedure. * gnu/system/grub.scm (grub-configuration-file): Change 'entries' to be a plain list instead of a list of monadic values. * gnu/system.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- guix/monads.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/monads.scm b/guix/monads.scm index f5c9e8e9c7..410fdbecb2 100644 --- a/guix/monads.scm +++ b/guix/monads.scm @@ -56,7 +56,8 @@ (define-module (guix monads) package-file package->derivation built-derivations - derivation-expression)) + derivation-expression + lower-inputs)) ;;; Commentary: ;;; @@ -319,6 +320,22 @@ (define* (package-file package (string-append out "/" file) out)))) +(define (lower-inputs inputs) + "Turn any package from INPUTS into a derivation; return the corresponding +input list as a monadic value." + ;; XXX: Should probably be in (guix packages). + (with-monad %store-monad + (sequence %store-monad + (map (match-lambda + ((name (? package? package) sub-drv ...) + (mlet %store-monad ((drv (package->derivation package))) + (return `(,name ,drv ,@sub-drv)))) + ((name (? string? file)) + (return `(,name ,file))) + (tuple + (return tuple))) + inputs)))) + (define derivation-expression (store-lift build-expression->derivation)) -- cgit v1.2.3