From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0GK8LpVLbGXjzwAAG6o9tA:P1 (envelope-from ) for ; Sun, 03 Dec 2023 10:34:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0GK8LpVLbGXjzwAAG6o9tA (envelope-from ) for ; Sun, 03 Dec 2023 10:34:13 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7827B22C52 for ; Sun, 3 Dec 2023 10:34:13 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=GnFVB9HH; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701596053; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=uI1Rga/ofz9DjdnkHzgQP8JjPdSU5LGQid1++0dCOZc=; b=R0LyyK5qgMYFxjlrgokjoP6/gMGfGRrCnFZfpKHaYaPk0bebOKYALzYhQKT2wJZ4SEKacH bMh/oDD9zGszoWJB4Kmxc5Mj2DBCJwMxZfRPGZC0fZI5l0GtRIItIbp0wmnrfDdCsfvFYh 6uoErSlOMUMIldjPHO+1dxB4MJYFFL8aSFG0Mp5Llos0gYFkb8zbKCqwF26DEapHh6Tp3C u3+atsiGskibY0YUFxXFf4LjcKcu1ILbplU00Bz/dVBoUcMTKwmvQ158dKxjbk+AMPH7Ni vo8sTC1+taBjVMaHwlXGVLhQc2/AJkQ5QpCJAl5LnGI9LLsxT4vGIglZtfdI0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=GnFVB9HH; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701596053; a=rsa-sha256; cv=none; b=RsbQQMbdYd2JvQbU7BBuYmarNrWlGLDNLargb2K1Dy2/NW+htMHQGPXmZtmMKWhUGQfMKL J3rrdMkoEnWCPMhA0Rd3i/x5K+tELV2VQtvpoR0zRfBw81Gb/ik4wqxJlY8Qt2MZVTUuS3 cRpcYleUz894CmvEmipVmvmkSWaGvujbneXFgflJEFrVG5/NMqy1JjCKd3fDw0djf8iyUd K/aWNdo9bXh0s5b/KX41dMLOc4wqH5nTChIeU3xEF2wXs+m9nzdq5dqYkJwqxcntsXMXxP dWtb3e6FRHWX+w5BcgptiKTAqxEPmlQP4FvpWTJ7pFoJSiKCgL3LPcM3ZrNyfg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9irK-0000Oe-JA; Sun, 03 Dec 2023 04:33:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9irJ-0000Nq-5B for guix-patches@gnu.org; Sun, 03 Dec 2023 04:33:53 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9irI-0005AI-QC for guix-patches@gnu.org; Sun, 03 Dec 2023 04:33:52 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9irS-00057l-AY for guix-patches@gnu.org; Sun, 03 Dec 2023 04:34:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67598] [PATCH] gnu: services: guix: Allow gexps evaluating to a list of build-machines Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Dec 2023 09:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67598 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67598@debbugs.gnu.org Cc: Saku Laesvuori X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170159603619681 (code B ref -1); Sun, 03 Dec 2023 09:34:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2023 09:33:56 +0000 Received: from localhost ([127.0.0.1]:59135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9irL-00057M-Sj for submit@debbugs.gnu.org; Sun, 03 Dec 2023 04:33:56 -0500 Received: from lists.gnu.org ([2001:470:142::17]:49412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9irK-000577-0M for submit@debbugs.gnu.org; Sun, 03 Dec 2023 04:33:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9ir3-0000JV-St for guix-patches@gnu.org; Sun, 03 Dec 2023 04:33:38 -0500 Received: from vmi571514.contaboserver.net ([75.119.130.101] helo=mail.laesvuori.fi) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9iqv-00051r-R1 for guix-patches@gnu.org; Sun, 03 Dec 2023 04:33:36 -0500 Received: from X-kone.lan (88-113-24-127.elisa-laajakaista.fi [88.113.24.127]) by mail.laesvuori.fi (Postfix) with ESMTPSA id 182AA3400B0; Sun, 3 Dec 2023 10:33:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1701596006; bh=++gTLDjUeMhNPmQ8bCUP6w82kkqkL5RAJHkPZAZAQBA=; h=From:To:Cc:Subject:Date; b=GnFVB9HHjtlVoK2UMiS/OfEF7mpgjDxvgqAS/5y7rLk8czfiHfOReWWGyT+BxOnp0 CIt3ULrEh42CIVafP0Vgfm+3dnEwZlkfTEEq7D7zWIWv9E7H8y1I7aJLvRSAD4vMNb 8I/0IcWai2lFOims5OCowYv3RpvoFOd9fJNeJ/WY= Date: Sun, 3 Dec 2023 11:31:42 +0200 Message-ID: <4cb4eac27ae7990eb9c79bcea0c05dbdbe0bdf37.1701595902.git.saku@laesvuori.fi> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=75.119.130.101; envelope-from=saku@laesvuori.fi; helo=mail.laesvuori.fi X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Saku Laesvuori X-ACL-Warn: , Saku Laesvuori via Guix-patches From: Saku Laesvuori via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.15 X-Spam-Score: -6.15 X-Migadu-Queue-Id: 7827B22C52 X-Migadu-Scanner: mx12.migadu.com X-TUID: dlqJnftqHeXF * 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 --- This enables doing things like the DNS-SD example mentioned in '2.4.2 Using the Offload Facility' directly from the operating-system declaration. doc/guix.texi | 9 ++++++--- gnu/services/base.scm | 8 +++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1fd2e21608..3e599742c3 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 @@ -19329,7 +19330,8 @@ Base Services (guix-configuration (build-machines (list #~(build-machine (name "foo.example.org") @dots{}) - #~(build-machine (name "bar.example.org") @dots{})))) + #~(list (build-machine (name "bar.example.org") @dots{}) + (build-machine (name "foobaz.example.org") @dots{}))))) @end lisp Additional build machines may be added @i{via} the @code{guix-extension} @@ -19385,7 +19387,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..beb710f95c 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" + `(apply append + (map (lambda (entry) + (if (list? entry) + entry + (list entry))) + ,machines))) machines-file)))) (define-record-type* base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767 -- 2.41.0