all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* (operating-system (packages ...)): hack to allow specifying outputs
@ 2016-03-06 12:56 Jan Nieuwenhuizen
  2016-03-06 23:12 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Nieuwenhuizen @ 2016-03-06 12:56 UTC (permalink / raw)
  To: guix-devel

Hi,

Is this documentation in gnu/system.scm

  (packages operating-system-packages             ; list of (PACKAGE OUTPUT...)
            (default %base-packages))             ; or just PACKAGE

is conveying future intent?  I cannot get it to work without the patch
below.

Obviously, this needs some work...I could do with some help finding the
desired scheme meme to map a function with optional arguments.

Greetings, Jan


diff --git a/gnu/services.scm b/gnu/services.scm
index ffba418..81e201c 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -455,10 +455,12 @@ FILES must be a list of name/file-like object pairs."
                 (compose concatenate)
                 (extend append)))
 
+(define (pair?? x) (and (pair? x) x))
+
 (define (packages->profile-entry packages)
   "Return a system entry for the profile containing PACKAGES."
   (mlet %store-monad ((profile (profile-derivation
-                                (manifest (map package->manifest-entry
+                                (manifest (map (lambda (x) (apply package->manifest-entry (or (pair?? x) `(,x))))
                                                (delete-duplicates packages eq?))))))
     (return `(("profile" ,profile)))))
 
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: (operating-system (packages ...)): hack to allow specifying outputs
  2016-03-06 12:56 (operating-system (packages ...)): hack to allow specifying outputs Jan Nieuwenhuizen
@ 2016-03-06 23:12 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2016-03-06 23:12 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> Is this documentation in gnu/system.scm
>
>   (packages operating-system-packages             ; list of (PACKAGE OUTPUT...)
>             (default %base-packages))             ; or just PACKAGE
>
> is conveying future intent?  I cannot get it to work without the patch
> below.

宋文武 just provided a nice little fix for this.  Thanks for bringing it
up!  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-06 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06 12:56 (operating-system (packages ...)): hack to allow specifying outputs Jan Nieuwenhuizen
2016-03-06 23:12 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.