nix-community / nix-on-droid

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

`nix-shell -p` works as expected, but `nix-on-droid switch fails #265

Closed MikiVanousek closed 1 year ago

MikiVanousek commented 1 year ago

After a fresh install I manually added a chanel (not in the instructions). Installing packages works, but not nix-on-droid switch.

-bash-5.1$ nix-on-droid switch
Building activation package...
error: file 'nix-on-droid/modules' was not found in the Nix search path (add it using $NIX_PATH or -I)
Gerschtli commented 1 year ago

Please show the output of the following commands:

nix-channel --list
cat ~/.nix-channels
echo $NIX_PATH
nix --version

You installed nix-on-droid with the channel setup then, I suppose, right?

MikiVanousek commented 1 year ago
nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable

cat ~/.nix-channels
https://nixos.org/channels/nixpkgs-unstable nixpkgs

echo $NIX_PATH
nixpkgs=/data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs/:/data/data/com.termux.nix/files/home/.nix-defexpr/channels

nix --version
nix (Nix) 2.11.1
MikiVanousek commented 1 year ago

You installed nix-on-droid with the channel setup then, I suppose, right?

I am not sure what that means. I installed the app from F-Droid.

Gerschtli commented 1 year ago

I am not sure what that means. I installed the app from F-Droid.

When starting the app, you will be given a prompt (a yes/no question) if you want to bootstrap via a channel or a flake setup. It looks to me, that you were selecting the flake setup because the nix-on-droid channel is missing and you mentioned that the nixpkgs channel was also missing.

Please have a look if ~/.config/nixpkgs/nix-on-droid.nix exists (default config file for channel based setup) or if there is a ~/.config/nix-on-droid directory with a flake.nix. For the actual differences between the bootstrap of these 2 options, you can have a look at https://github.com/t184256/nix-on-droid/blob/master/modules/environment/login/login-inner.nix#L52-L96 if you are interested.

If you are not that familiar with nix or especially flakes, I would recommend you to clear the app data, and bootstrap it again with the channel setup (meaning to answer "Do you want to set it up with flakes? (y/N)" with "N" on initial bootstrap). :)

MikiVanousek commented 1 year ago

Thanks a lot. This entire project is AMAZING. I am amazed at what works. For example localhost. I can now run Pluto notebooks on my phone! I suspect this might make it possible for me to make Android my main OS.

It would be nice to have an extensive Limitations section.