nix-community / nix-on-droid

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

Create SSH module #325

Open Pablo1107 opened 9 months ago

Pablo1107 commented 9 months ago

Currently there is an article on the wiki stating how to manually set up an ssh daemon. Maybe this can be ported into a nix-on-droid module.

I may create a PR for this if you think this would be a nice-to-have.

t184256 commented 9 months ago

See https://github.com/nix-community/nix-on-droid/pull/203

Pablo1107 commented 9 months ago

See #203

Seems that PR was abandoned by the original author. I'll try to take a look if I have a chance. Thank you!

pinage404 commented 4 months ago

Thanks to the wiki, i was able to successfully install an SSH server !

https://gitlab.com/pinage404/dotfiles/-/commit/405665aeb8d5468184375ad69767772eb06e971b#29ca4eb2dccce271cd9a3d588f9b50575ec5607c_0_2

Yeshey commented 3 months ago

Cool! I had to remove the option -D # don't detach into a daemon process because it would stay stuck on that step, and without it seems to get stuck when I run exit so I have to kill the app.

added your sshd-start to the startup files of bash and zsh with home-manager, and it works great

  # For starting the ssh server
  programs.zsh = {
    initExtra = ''
      sshd-start
    '';
  };
  programs.bash = {
    initExtra = ''
      sshd-start
    '';
  };

with your config i can connect to my phone from my PC through something like ssh nix-on-droid@192.168.1.254 -p 8022