unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Saku Laesvuori via Guix-patches via <guix-patches@gnu.org>
To: ludo@gnu.org
Cc: 67598@debbugs.gnu.org, Saku Laesvuori <saku@laesvuori.fi>
Subject: [bug#67598] [PATCH v2] gnu: services: guix: Allow gexps evaluating to a list of build-machines
Date: Mon, 11 Dec 2023 09:26:14 +0200	[thread overview]
Message-ID: <ee039e56f323923f94fc15205cecd551ff02ea3a.1702279574.git.saku@laesvuori.fi> (raw)
In-Reply-To: <4cb4eac27ae7990eb9c79bcea0c05dbdbe0bdf37.1701595902.git.saku@laesvuori.fi>

* 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
---
 doc/guix.texi         | 6 ++++--
 gnu/services/base.scm | 8 +++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1fd2e21608..e74aa631b7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19316,7 +19316,8 @@ Base Services
 @anchor{guix-configuration-build-machines}
 @item @code{build-machines} (default: @code{#f})
 This field must be either @code{#f} or a list of gexps evaluating to a
-@code{build-machine} record (@pxref{Daemon Offload Setup}).
+@code{build-machine} record or to a list of @code{build-machine} records
+(@pxref{Daemon Offload Setup}).
 
 When it is @code{#f}, the @file{/etc/guix/machines.scm} file is left
 untouched.  Otherwise, the list of of gexps is written to
@@ -19385,7 +19386,8 @@ Base Services
 A list of strings where each element is a substitute URL.
 
 @item @code{build-machines} (default: @code{'()})
-A list of gexps that evaluate to @code{build-machine} records
+A list of gexps that evaluate to @code{build-machine} records or to a list of
+@code{build-machine} records.
 (@pxref{Daemon Offload Setup}).
 
 Using this field, a service may add new build machines to receive builds
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 82c6940780..f060feab12 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1765,7 +1765,13 @@ (define (guix-machines-files-installation machines)
             (mkdir-p (dirname machines-file)))
 
         ;; Installed the declared machines file.
-        (symlink #+(scheme-file "machines.scm" machines)
+        (symlink #+(scheme-file "machines.scm"
+                                #~((@ (srfi srfi-1) concatenate)
+                                   (map (lambda (entry)
+                                          (if (build-machine? entry)
+                                            (list entry)
+                                            entry))
+                                        #$machines)))
                  machines-file))))
 
 (define-record-type* <guix-configuration>

base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
-- 
2.41.0





  parent reply	other threads:[~2023-12-11  7:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-03  9:31 [bug#67598] [PATCH] gnu: services: guix: Allow gexps evaluating to a list of build-machines Saku Laesvuori via Guix-patches via
2023-12-10 21:18 ` Ludovic Courtès
2023-12-11  7:26 ` Saku Laesvuori via Guix-patches via [this message]
2023-12-14 21:08   ` bug#67598: [PATCH v2] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee039e56f323923f94fc15205cecd551ff02ea3a.1702279574.git.saku@laesvuori.fi \
    --to=guix-patches@gnu.org \
    --cc=67598@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=saku@laesvuori.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).