Hi Ludovic,

Ludovic Courtès <[email protected]> writes:

> Hi Hilton,
>
> Hilton Chain <[email protected]> skribis:
>
>> Nix flake has a convenient URL-like syntax to represent flake references and 
>> I
>> wonder if something similar can be implemented in Guix.  I think one 
>> approach is
>> to transform .guix-channel into a channels.scm, and to do so will require 
>> more
>> information to be included in .guix-channel.  In this mail I'll explain why.
>
> What’s the end goal?  To support single-command program execution like
> in the ‘nix shell’ examples you gave?  (I’m asking because there’s
> nothing equivalent to “flake references” in Guix, AIUI.)

Yes, so it'll be more convenient to use a package or a procedure from a channel
temporarily, at the same time allowing specifying the commit and branch to use.

Speaking of commit or branch, it would be nice to support channel selection in
‘--url=’, ‘--commit=’, and ‘--branch=’ as well.

>> The natural approach I can think of is to use the existing interfaces and
>> transform .guix-channel into channels.scm, so we can do something like
>>
>> --8<---------------cut here---------------start------------->8---
>> guix time-machine -C git+https://example.com/channel -- shell patchelf -- 
>> patchelf --help
>> --8<---------------cut here---------------end--------------->8---
>>
>> Then I realized that .guix-channel doesn't contain enough information for the
>> channel itself.
>
> Yes, and ‘.guix-channel’ is fundamentally something very different from
> what one specifies in ‘channels.scm’.
>
> Now, there’s one thing we can perhaps draw inspiration from, and that’s
> SWHID; we can refer to a full-blown channel file by its SWHID already:
>
>   guix time-machine \
>   -C swh:1:cnt:ae02d8ba3538a385ee799e61cdd0dfc5e14a8d1b \
>   -- describe
>
> This only works because a channel file happened to be archived by SWH,
> though.

It's useful, but the ‘channels.scm’ must be available somewhere.  If a channel
repository ships a ‘channels.scm’ file by itself, the forge that hosts the
channel must support serving that file as well.

‘.guix-channel’ already contains most information for a ‘channels.scm’ when the
channel declares its dependencies.  What I think is, why not add more into
‘.guix-channel’ so it contains all information for a ‘channels.scm’?


Furthermore, with more information in ‘.guix-channel’, we can develop utilities
for channel maintenance as well.  For example outputing ‘channels.scm’ for the
current channel, channel pinning, and portable scripts.

On the scripts part, currently ‘guix system search’ and ‘guix home search’ don't
support community channels.  The ‘committer.scm’ script also requires
modification to properly work in other channels.  To be portable, all of them
need to set a convention and also require channels to expose some information.
I think ‘.guix-channel’ is where we can expose the information.


Thanks

Reply via email to