I'm generally not a big fan of switch
, as you experienced, you risk a lot of generations that you don't actually need. Also, in some cases, switching isn't possible (e.g. you remove sddm
and on switching, nix wants to restart all services related to the no longer existing sddm user).
My usual workflow is for smaller changes to just do nixos-rebuild test
and try out things, and when it suits my needs finalize via nixos-rebuild boot
. Bigger stuff I try to isolate and then do a nixos-rebuild boot
only.