I use the following command which works fine, you have to adapt it for a non flake config.
nixos-rebuild switch -j auto --use-remote-sudo --build-host localhost --target-host $fqdn --flake ".#$host"
Maybe this helps as well:
I use the following command which works fine, you have to adapt it for a non flake config.
nixos-rebuild switch -j auto --use-remote-sudo --build-host localhost --target-host $fqdn --flake ".#$host"
Maybe this helps as well: