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.
This commit is contained in:
Ludovic Courtès 2013-12-09 21:32:36 +01:00
parent 593c3fe600
commit 033adfe7e0
5 changed files with 413 additions and 261 deletions

View file

@ -56,7 +56,8 @@
package-file
package->derivation
built-derivations
derivation-expression))
derivation-expression
lower-inputs))
;;; Commentary:
;;;
@ -319,6 +320,22 @@ OUTPUT directory of 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))