Hi Sergio,

Sergio Pastor Pérez <sergio.pastorpe...@gmail.com> writes:

> Rutherther <ruthert...@ditigal.xyz> writes:
>> what I am asking is how this will be achieved - coverage of same use
>> case. Possibly I am just missing something, so let's take guix system
>> reconfigure as an example. Could you point where I am wrong in my
>> reasoning?
>>
>> 1. Guix system reconfigure expects a file as argument, that will return
>> operating-system record.
>> 2. with-transformation uses map-derivation, it will work on
>> operating-system-derivation, not on operating-system, and
>> return a derivation, not an operating-system.
>> 3. Therefore, without changes to guix system reconfigure, it cannot be used
>> as the returned object from file is not operating-system.
>
> Yes, you are correct. I'm not sure if `guix system reconfigure' accepts
> a derivation. If it does not, we will have to adapt it.
>
> It would make sense that reconfigure accepted a derivation since
> `guix build' does. For example the following file it's valid for
> `guix build -f <file>`:

It doesn't. And I don't think it will be easy to make the whole
guix system stuff work with raw derivations.

The thing is, the derivation being built changes according to the
action, the vm and container have a different derivation than
the one used with reconfigure.

On top of that, and probably more importantly, the operating system
fields are utilized for various checks or even for installation, ie. the
bootloader is taken out of operating-sytem-bootloader, not from the
operating system derivation (I think the operating-system-derivation
doesn't even depend on the bootloader at all), and maybe even
more stuff I am missing.

If we were to talk about the easiest approach, I think that the easiest
would be to make an operating system field like `transformation`
that would get applied when the derivation is being lowered[1]
in the system script. Additionally, guix system doesn't currently
handle regular guix transformations, the same could be done about
those to start supporting it with guix system. The only questionable
thing is, then, what all derivations should be transformed,
if only the operating system itself or also the bootloader, vm (qemu...)
etc.

[1] See guix/scripts/system.scm (system-derivation-for-action)

Regards,
Rutherther

Reply via email to