Re: service extensions to guix-service-type

2022-04-18 Thread Ludovic Courtès
Hi Justin,

Justin Veilleux  skribis:

> For my os.scm, I want to create a service which encapsulates the
> process of adding channels to the global channels file, adding
> substitute urls to the daemon and also adding authorized keys to the
> daemon. With the service extension system, I was able to do the first
> thing by extending `special-files-service-type`. However, I cannot do
> the last two things, because the current definition of
> guix-service-type only exposes chroot-directories (what is the use
> case for this, btw?).

It used to be that qemu-binfmt support for Guix relied on extending
‘guix-service-type’ with extra “chroot directories”; this was changed in
commit 77c2f4e2068ebec3f384c826c5a99785125ff72c, so this extension
mechanism is no longer used.

Perhaps we could now use the extension point for the purposes you
suggest?

Alternatively (or in addition to that), Brice (Cc’d) proposed adding a
‘channels’ field to :

  https://issues.guix.gnu.org/49610

Thanks,
Ludo’.



Re: service extensions to guix-service-type

2022-04-11 Thread Kaelyn
--- Original Message ---
On Sunday, April 10th, 2022 at 8:19 PM, Justin Veilleux  
wrote:


> Hi guix-devel.
>
> For my os.scm, I want to create a service which encapsulates the process
> of adding channels to the global channels file, adding substitute urls
> to the daemon and also adding authorized keys to the daemon. With the
> service extension system, I was able to do the first thing by extending
> `special-files-service-type`. However, I cannot do the last two things,
> because the current definition of guix-service-type only exposes
> chroot-directories (what is the use case for this, btw?).
>
> Is there a reason for this particular design? I will probably submit a
> patch to add this functionality.
>
> Cheers.

Hi Justin,

You should be able to add authorized keys and substitute URLs by modifying the 
guix-service-type's config in your OS's list of services. For example:

(modify-services
 %desktop-services
 (guix-service-type config =>
(guix-configuration
 (inherit config)
 (substitute-urls
  (cons* "http://myserver:8880;
 (guix-configuration-substitute-urls config)))
 (authorized-keys
  (cons* (gexp:local-file "myserver-signing-key.pub")
 (guix-configuration-authorized-keys config))

(More info on the guix-configuration fields can be found at 
https://guix.gnu.org/en/manual/devel/en/html_node/Base-Services.html#Base-Services
 :)

Hope that helps!

Cheers,
Kaelyn