NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.55k stars 1.45k forks source link

Can't resolve any domain name using nix static on termux #8144

Open lucasew opened 1 year ago

lucasew commented 1 year ago

Describe the bug

I just "installer" nix by downloading the binary using the following command on termux (Android):

curl -L "https://hydra.nixos.org/job/nix/master/buildStatic.$(uname -m)-linux/latest/download-by-type/file/binary-dist" -o nix

Any operation that fetch stuff from the Internet fails with a "cant resolve domain".

Steps To Reproduce

  1. Get an Android device with Android 7 or above
  2. Install termux
  3. curl -L "https://hydra.nixos.org/job/nix/master/buildStatic.$(uname -m)-linux/latest/download-by-type/file/binary-dist" -o nix
  4. ./nix run github:nixos/nixpkgs#hello --extra-experimental-features 'flakes nix-command' --no-use-registries
warning: error: unable to download 'https://api.github.com/repos/nixos/nixpkgs/commits/HEAD': Couldn't resolve host name (6); retrying in 255 ms                                 warning: error: unable to download 'https://api.github.com/repos/nixos/nixpkgs/commits/HEAD': Couldn't resolve host name (6); retrying in 630 ms                                 warning: error: unable to download 'https://api.github.com/repos/nixos/nixpkgs/commits/HEAD': Couldn't resolve host name (6); retrying in 1064 ms                                warning: error: unable to download 'https://api.github.com/repos/nixos/nixpkgs/commits/HEAD': Couldn't resolve host name (6); retrying in 2310 ms                                error:                                                            … while fetching the input 'github:nixos/nixpkgs'                                                                     error: unable to download 'https://api.github.com/repos/nixos/nixpkgs/commits/HEAD': Couldn't resolve host name (6)

Expected behavior

Nix downloading gnu hello and printing hello world.

nix-env --version output

GC Warning: Could not open /proc/stat                      nix (Nix) 2.15.0pre20230401_8ae9d66

Additional context

Moto G52 (rhode) running unrooted stock.

Priorities

Add :+1: to issues you find important.

SuperSandro2000 commented 1 year ago

Android is not a standard linux and the standard dns resolution ways do not fully apply to it. This is already fixed over here https://github.com/t184256/nix-on-droid .