Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuilt index not found #42

Open
MarkusLohmayer opened this issue Dec 26, 2022 · 4 comments
Open

Prebuilt index not found #42

MarkusLohmayer opened this issue Dec 26, 2022 · 4 comments

Comments

@MarkusLohmayer
Copy link

I tried to setup comma together with the prebuilt index from
https://github.com/Mic92/nix-index-database
but I get Warning: Nix-index database does not exist.

I am on macOS and I have
nix-index-database.hmModules.nix-index as a home-manager module,
further I have programs.nix-index.enable = true;
and finally I have comma in home.packages.

You can see the precise setup here:

Thanks!

@eclairevoyant
Copy link

Yep, seems to be broken for this use case. Maybe it has to do with the wrapper that it's using.

@bestlem
Copy link

bestlem commented Mar 13, 2024

It also failed for me but I imported via the darwin module

so nix-index-database.darwinModules.nix-index
and comma installed system wide via environment.systemPackages

The command-not-found hook for nix-index does however work so the infrastructure is there.

@lancelet
Copy link

lancelet commented Oct 2, 2024

I have a similar setup, but was able to get around the problem by re-generating the index:

The error:

$ , cowsay neato
Warning: Nix-index database does not exist, either obtain a prebuilt database from https://github.com/Mic92/nix-index-database or try updating with `nix run 'nixpkgs#nix-index' --extra-experimental-features 'nix-command flakes'`.
nix-locate failed with: error: reading from the database at '/Users/jsm/.cache/nix-index/files' failed.
This may be caused by a corrupt or missing database, try (re)running `nix-index` to generate the database.
If the error persists please file a bug report at https://github.com/nix-community/nix-index.
caused by: No such file or directory (os error 2)

Workaround (doing what it suggests) - takes 10 minutes or so:

$ nix run 'nixpkgs#nix-index' --extra-experimental-features 'nix-command flakes'
+ querying available packages
+ generating index: 87498 paths found :: 42779 paths not in binary cache :: 00000 paths in queue
+ wrote index of 39,021,028 bytes

Then it works, but with a bunch of warnings about missing channels:

$ , cowsay neato
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
 _______
< neato >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

I'm not sure about those warnings. Googling only says something about them not being relevant when flakes are used... (or something?)

I'm also concerned that the state it dumped in ~/.cache/nix-index/files requires a manual update, but that's less objectionable that the warnings.

@SuperSandro2000
Copy link
Member

I'm not sure about those warnings. Googling only says something about them not being relevant when flakes are used... (or something?)

Those are because you have the directory in NIX_PATH but it doesn't exist. It is a warning from nix and has nothing to do with comma.

I'm also concerned that the state it dumped in ~/.cache/nix-index/files requires a manual update, but that's less objectionable that the warnings.

Yes, that's why many people use the index-db via flakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants