An idea would be to set restartIfChanged
to false in the systemd service nix and then add a check just for whether nix changed somewhere at the beginning of https://github.com/NixOS/nixpkgs/blob/78956495de9930857962467b50de066e98eeb10b/nixos/modules/system/activation/switch-to-configuration.pl and restart it before anything else
But I’m really just guessing