Subject: [bug#49610] [PATCH v2] sevices: guix: Add channels field.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 03 Jan 2022 12:32:31 +0100

Hi Brice,

Brice Waegeneire <[email-masked]> skribis:

> * doc/guix.texi (Channels): Specify that '/etc/guix/channels.scm'
>   contains channels configuration.
>   (Base Services): Document 'guix-configuration-channels' field.
> * gnu/services/base.scm (install-channels-file): New procedure.
>   (guix-configuration): Add channels field.
>   (guix-activation): Use 'install-channels-file' procedure.
> ---
>  doc/guix.texi         | 15 ++++++++++++++-
>  gnu/services/base.scm | 42 ++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 54 insertions(+), 3 deletions(-)
>
> I've changed the type of the new field from a list to a s-expression, I'm not
> sure if it should be a G-exp instead.  The documentation of the
> 'channels' field as been updated as suggested.

It’s OK to keep it this way.

> Ludovic Courtès <[email-masked]> writes:
>
>>> +;; FIXME Does this gexp should be build before boot, such as
>>> +;; substitute-key-authorization does?
>>
>> There’s a grammatical issue :-), but also I’m not sure: what are you
>> worried about?
>
> This is related to your commit 8b3ad455be7e8ace35a2eaebf7fffbb611280852, where
> you added pre-computation of the ACL to make « [...] the first boot slightly
> faster ».  Should this be done in this case too?

Ah no, commit 8b3ad455be7e8ace35a2eaebf7fffbb611280852 is about
pre-generating /etc/guix/acl.  In the case of /etc/guix/channels.scm,
there’s nothing to pre-generate though since we’re just dumping the sexp
as-is to /etc/guix/channels.scm, so I think this comment can be safely
removed.

[...]

> +@item @code{channels} (default: @code{'(cons* %default-channels)})

I’d make the default #~%default-channels, no need for ‘cons*’.

> +@quotation Note
> +When booting or reconfiguring to a system where @code{channels}
> +is not null, the existing @file{/etc/guix/channels.scm} file is backed up as
> +@file{/etc/guix/channels.scm.bak} if it was determined to be a manually modified
> +file.  This is to facilitate migration from earlier versions, which
> +allowed for in-place modifications to @file{/etc/guix/channels.scm}.
> +@end quotation

“When (…) where @code{channels} is not null” does not match the actual
code, does it?

Otherwise LGTM, thanks!

Ludo’.