nix-community / nix-on-droid

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

bug: nix-shell on flake install #288

Closed cvoges12 closed 10 months ago

cvoges12 commented 10 months ago

Steps to reproduce

  1. Install nix-on-droid
  2. Press y for flake
  3. Run something like nix-shell -p python3

Error

warning: Nix search path entry '/data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs/' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «string»:1:25:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (python3) ]; } ""
             |                         ^
(use '--show-trace' to show detailed location information)

And with --show-trace:

warning: Nix search path entry '/data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs/' does not exist, ignoring
error:
       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at «string»:1:1:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (python3) ]; } ""
             | ^

       … while realising the context of a path

       at «string»:1:18:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (python3) ]; } ""
             |                  ^

       error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «string»:1:25:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (python3) ]; } ""
             |
t184256 commented 10 months ago

Works as expected, flakes install has no channels. Either add one or use flakes: `nix shell 'nixpkgs#python3'.