[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
22/22: gnu: guix-configuration: Improve offload build-machines.
From: |
guix-commits |
Subject: |
22/22: gnu: guix-configuration: Improve offload build-machines. |
Date: |
Sat, 4 May 2024 13:16:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit ef8ab6ab66c4d629699d175938ef1912941d4dce
Author: Ian Eure <ian@retrospec.tv>
AuthorDate: Sun Apr 7 12:20:59 2024 -0700
gnu: guix-configuration: Improve offload build-machines.
It’s currently difficult to programmatically add a build-machine, because
the
`service-extension' mechanism is the only facility which can do that. It
relies on the `guix-service-type', ala:
(service-extension guix-service-type
(guix-extension (build-machines (list ...))))
...but `guix-service-type' is already instantiated as part of
`%base-services', and replacing it may lose other configuration, like
substitute servers and authorized keys.
Additionally, a default value of `#f' for the build-machines field requires
guarding uses of the field with:
(or (guix-build-machines config) '())
Changing the default to be the empty list avoids that. One can now add
build-machines with code such as:
(modify-services %base-services
(guix-service-type
config =>
(guix-configuration
(inherit config)
(authorized-keys
(cons %build-machine-key
(guix-configuration-authorized-keys config)))
(build-machines (cons #~(build-machine ...)
(guix-configuration-build-machines
config))))))
* gnu/services/base.scm (guix-configuration): Rename `guix-build-machines'
to
`guix-configuration-build-machines' and export it. Change the default from
`#f' to the empty list.
* gnu/services/base.scm (guix-activation): Update the build-machines test
and
reverse the conditions.
Change-Id: I6780c6a5579fd9d4b4f22ee2b2bf7ba7a0454407
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
gnu/services/base.scm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 3f912225a0..5cf6083821 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -212,6 +212,7 @@
guix-configuration-guix
guix-configuration-build-group
guix-configuration-build-accounts
+ guix-configuration-build-machines
guix-configuration-authorize-key?
guix-configuration-authorized-keys
guix-configuration-use-substitutes?
@@ -1848,8 +1849,8 @@ archive' public keys, with GUIX."
(default #f))
(tmpdir guix-tmpdir ;string | #f
(default #f))
- (build-machines guix-build-machines ;list of gexps | #f
- (default #f))
+ (build-machines guix-configuration-build-machines ;list of gexps | '()
+ (default '()))
(environment guix-configuration-environment ;list of strings
(default '())))
@@ -2044,10 +2045,10 @@ proxy of 'guix-daemon'...~%")
#$(and channels (install-channels-file channels))
;; ... and /etc/guix/machines.scm.
- #$(if (guix-build-machines config)
+ #$(if (null? (guix-configuration-build-machines config))
+ #~#f
(guix-machines-files-installation
- #~(list #$@(guix-build-machines config)))
- #~#f))))
+ #~(list #$@(guix-configuration-build-machines config)))))))
(define-record-type* <guix-extension>
guix-extension make-guix-extension
@@ -2093,9 +2094,9 @@ proxy of 'guix-daemon'...~%")
(substitute-urls (append (guix-extension-substitute-urls
extension)
(guix-configuration-substitute-urls
config)))
(build-machines
- (and (or (guix-build-machines config)
+ (and (or (guix-configuration-build-machines config)
(pair? (guix-extension-build-machines extension)))
- (append (or (guix-build-machines config) '())
+ (append (guix-configuration-build-machines config)
(guix-extension-build-machines extension))))
(chroot-directories
(append (guix-extension-chroot-directories extension)
- 08/22: services: cuirass: Remove use-substitutes? configuration option., (continued)
- 08/22: services: cuirass: Remove use-substitutes? configuration option., guix-commits, 2024/05/04
- 14/22: gnu: Add perl-string-util., guix-commits, 2024/05/04
- 11/22: gnu: Add perl-html-selector-xpath., guix-commits, 2024/05/04
- 07/22: services: cuirass: Add new configuration options., guix-commits, 2024/05/04
- 09/22: gnu: gwenhywfar: Update to 5.10.2., guix-commits, 2024/05/04
- 21/22: gnu: gnucash: Update to 5.6., guix-commits, 2024/05/04
- 10/22: gnu: aqbanking: Update to 6.5.4., guix-commits, 2024/05/04
- 05/22: packages: Reduce code bloat due to list allocation in input fields., guix-commits, 2024/05/04
- 16/22: gnu: Add perl-html-tokeparser-simple., guix-commits, 2024/05/04
- 06/22: services: cuirass: Use separate extra options for cuirass web process., guix-commits, 2024/05/04
- 22/22: gnu: guix-configuration: Improve offload build-machines.,
guix-commits <=
- 03/22: records: Do not inline the constructor., guix-commits, 2024/05/04
- 19/22: gnu: Add perl-spreadsheet-xlsx., guix-commits, 2024/05/04
- 13/22: gnu: Add perl-web-scraper., guix-commits, 2024/05/04
- 17/22: gnu: Add perl-digest-perl-md5., guix-commits, 2024/05/04
- 02/22: packages: Reduce bloat induced by ‘sanitize-inputs’., guix-commits, 2024/05/04
- 20/22: gnu: perl-finance-quote: Update perl-finance-quote., guix-commits, 2024/05/04
- 18/22: gnu: Add perl-spreadsheet-parseexcel., guix-commits, 2024/05/04
- 12/22: gnu: Add perl-html-treebuilder-xpath., guix-commits, 2024/05/04