nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.32k stars 74 forks source link

Cannot rsync to nix-on-droid from PC #405

Closed amalgame21 closed 1 month ago

amalgame21 commented 2 months ago

From PC

$ rsync -avvvvvvvvv ./flake.nix phonenix:~/
cmd=<NULL> machine=phonenix user=<NULL> path=~/
cmd[0]=ssh cmd[1]=phonenix cmd[2]=rsync cmd[3]=--server cmd[4]=-vvvvvvvvvlogDtpre.iLsfxCIvu cmd[5]=. cmd[6]=~/
opening connection using: ssh phonenix rsync --server -vvvvvvvvvlogDtpre.iLsfxCIvu . "~/"  (7 args)
msg checking charset: UTF-8
bash: line 1: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
[sender] _exit_cleanup(code=12, file=io.c, line=231): entered
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.3.0]
[sender] _exit_cleanup(code=12, file=io.c, line=231): about to call exit(12)

Are rsync, sshfs, sftp not supported? What is the best alternative to transfer files without copying the files to /sdcard? Thanks!

pinage404 commented 2 months ago

Hello,

You may be interested by this issue https://github.com/nix-community/nix-on-droid/issues/325#issuecomment-2227140446

shelvacu commented 1 month ago

you need to install rsync in nix-on-droid. in your config:

  environment.packages = with pkgs; [ rsync ];
amalgame21 commented 1 month ago

rsync suddenly works, but sshfs still failed. Maybe it has something to do with SFTP subsystem

$ sshfs -d destination:/home/user sshfs-mountpoint
SSHFS version 3.7.3
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-2> <destination> <-s> <sftp>
subsystem request failed on channel 0
read: Connection reset by peer

related issue: https://github.com/nix-community/nix-on-droid/issues/307