[Nix-dev] nested child configurations - was: multiple full system profiles
Mathijs Kwik
mathijs at bluescreen303.nl
Thu Feb 9 00:19:32 CET 2012
On Wed, Feb 8, 2012 at 11:11 PM, Marc Weber <marco-oweber at gmx.de> wrote:
> Excerpts from Mathijs Kwik's message of Wed Feb 08 22:50:57 +0100 2012:
>> How do I switch to/between subprofiles when running?
>> Does "nixos-rebuild switch" jump back to the main profile or is there
>> some "current variant" concept?
> /var/run/{booted/current}-system/bin/switch-configuration test
>
> Don't know - maybe there are additional paths.
>
> Read those scripts (switch-configuration ..) to find out
>
> Marc Weber
Thanks Marc,
I found that /var/run/{booted/current}-system contains a "fine-tune"
dir, with links to all child configurations.
They are just called child-1, child-2 and so on, in the order that
they are defined in nested.clone.
These contain bin/switch-to-configuration as well.
So I can run "/var/run/current-system/fine-tune/child-1/bin/switch-to-configuration
switch" to switch to that child-profile.
However, after that, /var/run/current-system actually points to that
child config (as was to be expected).
There is no "parent" link inside the child, so to switch back to the
main profile (or a sibling), I have to remember its store-path.
Another issue:
Running nixos-rebuild switch activates the new main profile, so if I
had a child config active, I get dropped out of that.
This is a big problem if I want to keep the main config really basic
(no X11) and layer desktop-stuff on top of that in a child-config, as
switching would kill the X server/kdm.
Using "boot" instead of "switch" prevents this, but then there is no
easy way to find the new profile and its children.
What I would like:
- Give child-profiles some link back to their parent. If a real link
would give cyclic dependency issues, a text file with just the store
path is probably enough too.
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.
Before trying to hack this myself, I would like to know if I missed anything.
Or why this might be a terrible idea to do?
Thanks,
Mathijs
More information about the nix-dev
mailing list