nix-community / nix-index

Quickly locate nix packages with specific files [maintainers=@bennofs @figsoda @raitobezarius]
Other
817 stars 50 forks source link

nix-index 0.1.2 does not work inside docker container #157

Open vroad opened 3 years ago

vroad commented 3 years ago

I executed following commands to run nix-index inside a container.

docker run --rm -it nixos/nix ash
nix-env -iA nixpkgs.nix-index
nix-index

Fails without useful info on errors.

2eaf09b88df2:/# nix-index
+ querying available packages
error: querying available packages failed
caused by: nix-env failed with error: nix-env failed with unknown exit code:

However, the same version (0.1.2) works without issues on Mac.

theduke commented 3 years ago

The Docker container probably doesn't have any channels configured.

You can fix that with

nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
espes commented 3 years ago

I believe this is due to running out of memory. Docker for mac by default only allocates 2GB of ram to containers, and nix-index seems to need about 6GB. This can be changed in the docker preferences

badele commented 1 year ago

@espes i confirm your response, i have intialy a vagrant box with 4GB of memory, after upgrade it to 8GB, the error disapear

I think the @bennofs can close this issue