nixos-rebuild boot or nixos-rebuild switch will update /nix/var/nix/profiles/system by default.
But with the -p foobar or --profile-name foobar option, they can be made to update /nix/var/nix/profiles/system-profiles/foobar instead and to create that profile if it doesn’t already exist.
If I’ve done that and want to get rid of one such additional system profile again, what should I do?
Should I simply manually delete it as follows?
sudo rm /nix/var/nix/profiles/system-profiles/foobar{,-*-link}
If so, are additional steps needed or is that all?
Or is there a nixos-* or nix-* command to do system profile removal?