nix-community/nix-on-droid

How to get recovered in a broken login shell?

Closed this issue · 2 comments

I put this in the nix-on-droid.nix

user.shell = pkgs.zsh;

and ran nix-on-droid switch --flake ~/.config/nix-on-droid/flake.nix and break the login shell.
Now I know I should use

 user.shell = "${lib.getExe pkgs.zsh}";

instead. Now it throws errors when I open nix-on-droid then it automatically exit immediately.
How can I recover it in this broken state?
If not, how can I backup the ~/.config/nix-on-droid folder in this state? Thank you for your help!

When setting a new shell, it's better to open new sessions to keep a working one running until you know you don't lock yourself out. Now, when you had locked yourself out, exit all sessions, long-press app icon, "Failsafe", execute /data/data/com.termux.nix/files/usr/bin/login bash, recover. More at #284.

It works!
Replacing the line with user.shell = "${lib.getExe pkgs.zsh}"; and run nix-on-droid switch result in error: creating directory '/data/local/tmp/nix-build-login-inner.drv-0': Permission denied error in the "Failsafe" shell.
So I delete the line and nix-on-droid switch run successfully.
I add back user.shell = "${lib.getExe pkgs.zsh}"; and run nix-on-droid switch later on in normal shell, it also run successfully.
Thank you very much for your help!