How do I use `ssh-ng` by default when copying path to remote host?

I realized I can use ssh-ng when copying paths between host and remote builders just by prefixing the hostname with ssh-ng:// in /etc/nix/machines.

However, when remotely building a target machine. Copying of the paths between the host and target will use regular ssh:

# nixos-rebuild switch --log-format internal-json --verbose --flake .#remotehost1 --target-host "remotehost1" |& nom --json
...
copying path '/nix/store/n1axb0xwihqfzijxmcna23rnw8h9c8s3-publicsuffix-list-0-unstable-2026-06-24' to 'ssh://remotehost1'
copying path '/nix/store/mhmg6w8pwyj8wx5qlgb0pclbrz4zln00-soju.conf' to 'ssh://remotehost1'
...

How do I use ssh-ng by default for all copy operations?

Have you tried --target-host ssh-ng://remotehost1?

1 Like

That worked, thanks.