Now I’m using some specialisation in my configuration.nix
{
specialisation = {
minimal = {
inheritParentConfig = false;
configuration = {
imports = [ xxx ];
};
};
}
And I can choose it in the boot menu to enter it, but after I do something like
nixos-rebuild switch
I find that my NixOS switchs to the default config instead of the specialisation.
So how can I tell nixos-rebuild
to switch to the specialisation?
2 Likes
you may find this thread useful NixOS Specialisations - How do you use them? - #7 by nixinator
Usually they appearing in the boot menu, i.e you must reboot
I’ve not use them for a while, so this might be old news.
zarel
3
Thanks to this funny repo I discovered how specializations work.
You can:
-
nixos-rebuild switch
to make the specializations available
- Activate or test the specializations by running
sudo /nix/var/nix/profiles/system/specialisation/
name/bin/switch-to-configuration switch
3 Likes
zarel
6
So it’s possible to nixos-rebuild switch --specialisation=<name>
now, thank you! 
3 Likes