When I run sudo nixos-rebuild switch .#..., I have a concern that my muscle memory will betray me one day, and accidentally switch to the wrong configuration. Is there a common way to remedy this?
In my case, my configurations are named after the machine’s model, and the hostname is unique to the machine itself. So I cannot check if the nixosConfiguration name matches networking.hostname, since they’re not the same. But I could maintain a mapping.
The easy way here is to have a configuration for each hostname (which can be an alias of one of the machine-model configurations), and then have nixos-rebuild switch simply pick the configuration with the matching hostname.