mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
gnu: services: Support channels when extending guix-service-type.
Most of the configuration for guix-service-type can be extended (build machines, substitutes, etc), but channels currently cannot. This commit adds support for that. * gnu/services/base.scm (guix-extension): Add `channels'. (guix-extension-merge): Merge channels. (guix-service-type): Add extension channels. * doc/guix.texi (Getting Substitutes from Other Servers): Use a service extension instead of modify-services. (Base Services, guix-extension): Document channel field. Change-Id: I26cd0556a536f49ecc61662fc10af080d6c6dc9f
This commit is contained in:
parent
93e4c03938
commit
3dec0dbf14
2 changed files with 20 additions and 18 deletions
|
|
@ -4018,12 +4018,9 @@ them in the specified order. You also need to explicitly authorize the
|
|||
public keys of substitute servers to instruct Guix to accept the
|
||||
substitutes they sign.
|
||||
|
||||
On Guix System, this is achieved by modifying the configuration of the
|
||||
@code{guix} service. Since the @code{guix} service is part of the
|
||||
default lists of services, @code{%base-services} and
|
||||
@code{%desktop-services}, you can use @code{modify-services} to change
|
||||
its configuration and add the URLs and substitute keys that you want
|
||||
(@pxref{Service Reference, @code{modify-services}}).
|
||||
On Guix System, this is achieved by extending the configuration of the
|
||||
@code{guix} service. @pxref{Service Composition, Service extensions}
|
||||
allow users to easily add new configuration information.
|
||||
|
||||
As an example, suppose you want to fetch substitutes from
|
||||
@code{guix.example.org} and to authorize the signing key of that server,
|
||||
|
|
@ -4035,18 +4032,13 @@ configuration will look something like:
|
|||
(operating-system
|
||||
;; @dots{}
|
||||
(services
|
||||
;; Assume we're starting from '%desktop-services'. Replace it
|
||||
;; with the list of services you're actually using.
|
||||
(modify-services %desktop-services
|
||||
(guix-service-type config =>
|
||||
(guix-configuration
|
||||
(inherit config)
|
||||
(substitute-urls
|
||||
(append (list "https://guix.example.org")
|
||||
%default-substitute-urls))
|
||||
(authorized-keys
|
||||
(append (list (local-file "./key.pub"))
|
||||
%default-authorized-guix-keys)))))))
|
||||
(cons
|
||||
(simple-service
|
||||
'my-guix-configuration guix-service-type
|
||||
(guix-extension
|
||||
(substitute-urls (list "https://guix.example.org"))
|
||||
(authorized-keys (list (local-file "./key.pub")))))
|
||||
%desktop-services)))
|
||||
@end lisp
|
||||
|
||||
This assumes that the file @file{key.pub} contains the signing key of
|
||||
|
|
@ -20702,6 +20694,9 @@ a guix service extension.
|
|||
@xref{Service Composition}, for more information.
|
||||
|
||||
@table @asis
|
||||
@item @code{channels} (default: @code{'()})
|
||||
A list of objects where each element is a channel record.
|
||||
|
||||
@item @code{authorized-keys} (default: @code{'()})
|
||||
A list of file-like objects where each element contains a public key.
|
||||
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@
|
|||
guix-extension
|
||||
guix-extension?
|
||||
guix-extension-authorized-keys
|
||||
guix-extension-channels
|
||||
guix-extension-substitute-urls
|
||||
guix-extension-chroot-directories
|
||||
|
||||
|
|
@ -2428,6 +2429,8 @@ guix-daemon have the right ownership."))
|
|||
(define-record-type* <guix-extension>
|
||||
guix-extension make-guix-extension
|
||||
guix-extension?
|
||||
(channels guix-extension-channels ;list of channel
|
||||
(default '()))
|
||||
(authorized-keys guix-extension-authorized-keys ;list of file-like
|
||||
(default '()))
|
||||
(substitute-urls guix-extension-substitute-urls ;list of strings
|
||||
|
|
@ -2439,6 +2442,8 @@ guix-daemon have the right ownership."))
|
|||
|
||||
(define (guix-extension-merge a b)
|
||||
(guix-extension
|
||||
(channels (append (guix-extension-channels a)
|
||||
(guix-extension-channels b)))
|
||||
(authorized-keys (append (guix-extension-authorized-keys a)
|
||||
(guix-extension-authorized-keys b)))
|
||||
(substitute-urls (append (guix-extension-substitute-urls a)
|
||||
|
|
@ -2464,6 +2469,8 @@ guix-daemon have the right ownership."))
|
|||
(extend (lambda (config extension)
|
||||
(guix-configuration
|
||||
(inherit config)
|
||||
(channels (append (guix-extension-channels extension)
|
||||
(guix-configuration-channels config)))
|
||||
(authorized-keys (append (guix-extension-authorized-keys extension)
|
||||
(guix-configuration-authorized-keys config)))
|
||||
(substitute-urls (append (guix-extension-substitute-urls extension)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue