[Nix-dev] nested child configurations - was: multiple full systemprofiles

Mathijs Kwik mathijs at bluescreen303.nl
Thu Feb 9 08:47:39 CET 2012


On Thu, Feb 9, 2012 at 8:41 AM, Michael Raskin <7c6f434c at mail.ru> wrote:
>>> What you should consider is using /nix/var/nix/profiles/system-*-link
>>> If I remember correctly, it is not affected by switches.
>>Cool, indeed, that's a better entry point than /var/nix/current-system.
>>I can now list and switch child profiles easily.
>
> So it is not afected. Nice to know, thanks for checking.
>
>>> While you are at that, I was always too lazy to add all children of
>>> top-3 (top n with n being parameter?) configurations in GRUB menu. If
>>> your use case would be helped by this idea, actually changing the script
>>> should be easy.
>>
>>The current grub behavior is ok. I rarely boot into previous
>>configurations, only if I screw something up.
>>In that case, booting the default lean base profile is fine.
>>So just the most recent child entries suffice.
>
> Heh. For me, default is the most bloated option. But of course, I always
> check that it can be booted before using any child of it.

That's another approach, probably easier too.
But I would like to see how it works the other way around.

>
>>>>I can then just use helper scripts to list all available child-configs
>>>>(from the top-level configuration) and switch to them.
>>>>- Have "nixos-rebuild boot" print the path to the config it just built
>>>>Then I can switch to the new config's child variant myself, performing
>>>>a child-to-child jump.
>>>
>>> That can be done via
>>>
>>> nixos-rebuild pull && nix-build /etc/nixos/nixos -A system --no-out-link
>>
>>That works. That doesn't update grub yet, so I need to
>>"switch-to-config boot" in the result directory, then switch-to-config
>>switch on its child.
>>So I guess that suffices for my goal.
>
> You could do nixos-rebuild switch then nix-build

Nope, that would switch to the main profile (the lean one), dropping
out of x11 and such, when I'm currently in the "desktop" child.
So I do need to just nixos-rebuild boot, then switch to new profile's
child manually.


But that works for now.

Now I must find a nice workflow on top of it, but the possibility
itself is very nice :)


>
>
>


More information about the nix-dev mailing list