From 4f62d8d6c74d1d9cec049cb5e22452b8d78655f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 9 Dec 2013 23:45:27 +0100 Subject: [PATCH] gnu: Allow a plain list of packages in 'operating-system'. * gnu/system.scm (union): Allow (PACKAGE OUTPUT), (PACKAGE), and PACKAGE. ()[packages]: Make the default a list of package? objects. * gnu/system/vm.scm (%demo-operating-system): Likewise. Add a few packages. --- gnu/system.scm | 18 ++++++++++-------- gnu/system/vm.scm | 33 +++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index c6b67a7a1c..642e4b275c 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -78,12 +78,14 @@ (define-record-type* operating-system (members '("guest")))))) (packages operating-system-packages ; list of (PACKAGE OUTPUT...) - (default `(("coreutils" ,coreutils) - ("grep" ,grep) - ("guile" ,guile) - ("bash" ,bash) - ("dmd" ,(@ (gnu packages dmd) dmd)) - ("guix" ,guix)))) + (default (list coreutils ; or just PACKAGE + grep + sed + findutils + guile + bash + (@ (gnu packages dmd) dmd) + guix))) (timezone operating-system-timezone) ; string (locale operating-system-locale) ; string @@ -134,11 +136,11 @@ (define builder (mlet %store-monad ((inputs (sequence %store-monad (map (match-lambda - ((name (? package? p)) + ((or ((? package? p)) (? package? p)) (mlet %store-monad ((drv (package->derivation p system))) (return `(,name ,drv)))) - ((name (? package? p) output) + (((? package? p) output) (mlet %store-monad ((drv (package->derivation p system))) (return `(,name ,drv ,output)))) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 8a490fbd6c..a81c84672b 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -25,9 +25,11 @@ (define-module (gnu system vm) #:use-module ((gnu packages base) #:select (%final-inputs guile-final gcc-final glibc-final + ld-wrapper binutils-final coreutils findutils grep sed)) #:use-module (gnu packages guile) #:use-module (gnu packages bash) + #:use-module (gnu packages less) #:use-module (gnu packages qemu) #:use-module (gnu packages parted) #:use-module (gnu packages zile) @@ -416,20 +418,23 @@ (define %demo-operating-system (uid 1000) (gid 100) (comment "Guest of GNU") (home-directory "/home/guest")))) - (packages `(("coreutils" ,coreutils) - ("bash" ,bash) - ("guile" ,guile-2.0) - ("dmd" ,dmd) - ("gcc" ,gcc-final) - ("libc" ,glibc-final) - ("inetutils" ,inetutils) - ("findutils" ,findutils) - ("grep" ,grep) - ("sed" ,sed) - ("procps" ,procps) - ("psmisc" ,psmisc) - ("zile" ,zile) - ("guix" ,guix))))) + (packages (list coreutils + bash + guile-2.0 + dmd + gcc-final + ld-wrapper ; must come before BINUTILS + binutils-final + glibc-final + inetutils + findutils + grep + sed + procps + psmisc + zile + less + guix)))) (define* (system-qemu-image #:optional (os %demo-operating-system)) "Return the derivation of a QEMU image of the GNU system."