‘nixos-rebuild’ now accepts an argument ‘--profile-name’ (or ‘-p’),
denoting the name of a system profile to use. The default is
‘system’, which maps to /nix/var/nix/profiles/system. Any other value
maps to /nix/var/nix/profiles/system-profiles/<name>. The GRUB menu
generator makes all system profiles available as submenus. For
instance, doing
$ nixos-rebuild boot -p test
will cause a menu named ‘NixOS - Profile 'test'’ to be added to the
GRUB boot menu, leaving the default system profile unaffected.
This is only supported for GRUB 2.