me
/
guix
Archived
1
0
Fork 0

services: guix: Allow gexps evaluating to a list of build-machines.

* 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 (Base Services): Document it.

Change-Id: Ie404562ca0b564413233c3a624046da831893dc3
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Saku Laesvuori 2023-12-11 09:26:14 +02:00 committed by Ludovic Courtès
parent a1347d09f1
commit 59d65f66c5
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 11 additions and 3 deletions

View File

@ -19399,7 +19399,8 @@ and DNS-SD.
@anchor{guix-configuration-build-machines} @anchor{guix-configuration-build-machines}
@item @code{build-machines} (default: @code{#f}) @item @code{build-machines} (default: @code{#f})
This field must be either @code{#f} or a list of gexps evaluating to a 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 When it is @code{#f}, the @file{/etc/guix/machines.scm} file is left
untouched. Otherwise, the list of of gexps is written to untouched. Otherwise, the list of of gexps is written to
@ -19468,7 +19469,8 @@ A list of file-like objects where each element contains a public key.
A list of strings where each element is a substitute URL. A list of strings where each element is a substitute URL.
@item @code{build-machines} (default: @code{'()}) @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}). (@pxref{Daemon Offload Setup}).
Using this field, a service may add new build machines to receive builds Using this field, a service may add new build machines to receive builds

View File

@ -1767,7 +1767,13 @@ archive' public keys, with GUIX."
(mkdir-p (dirname machines-file))) (mkdir-p (dirname machines-file)))
;; Installed the declared machines file. ;; Installed the declared machines file.
(symlink #+(scheme-file "machines.scm" machines) (symlink #+(scheme-file "machines.scm"
#~((@ (srfi srfi-1) append-map)
(lambda (entry)
(if (build-machine? entry)
(list entry)
entry))
#$machines))
machines-file)))) machines-file))))
(define-record-type* <guix-configuration> (define-record-type* <guix-configuration>