Describe the bug
nix copy does not work with ssh or ssh-ng store when max-connections is not the default value of 1. It hangs indefinitely in such a way that ctrl-c does not exit. In testing I have had to close the window when this happens, leaving zombie processes on the destination machine that need to be cleaned up.
Steps To Reproduce
Try running
nix copy --to 'ssh-ng://user@machine?max-connections=2' $(nix-build '<nixpkgs>' -A hello)
Expected behavior
The hello package runtime closure should get copied to the nix store of user@machine
Metadata
nix-env (Nix) 2.31.2
Additional context
Checklist
Add 👍 to issues you find important.