Subject: Re: [PATCH v2] gnu: services: guix: Allow gexps evaluating to a list of build-machines

From: Ludovic Courtès <[email-masked]>
Date: Thu, 14 Dec 2023 22:08:34 +0100

Hi,

Saku Laesvuori <[email-masked]> skribis:

> * gnu/services/base.scm (guix-machines-files-installation): Handle
> machines being a mixed list of build-machines and lists of
> build-machines.
> * doc/guix.texi: Document it.
>
> Change-Id: Ie404562ca0b564413233c3a624046da831893dc3

Applied with the small change below (hadn’t realized earlier that we
could use ‘append-map’).  Thanks!

Ludo’.

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 3a4d8e789c..6539bfd6ce 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1768,12 +1768,12 @@ (define (guix-machines-files-installation machines)
 
         ;; Installed the declared machines file.
         (symlink #+(scheme-file "machines.scm"
-                                #~((@ (srfi srfi-1) concatenate)
-                                   (map (lambda (entry)
-                                          (if (build-machine? entry)
-                                            (list entry)
-                                            entry))
-                                        #$machines)))
+                                #~((@ (srfi srfi-1) append-map)
+                                   (lambda (entry)
+                                     (if (build-machine? entry)
+                                         (list entry)
+                                         entry))
+                                   #$machines))
                  machines-file))))
 
 (define-record-type* <guix-configuration>