Nix-index: not in binary cache

Hello guys. I’m noob in nix and nixos. I tried to launch nix-index and no…


I tried to update nix channels, tried to delete ~/.cache/nix-index and ~/.cache/nix, etc. nixos-rebuild doesn’t help

Could you run nix-shell -p nix-info --run "nix-info -m" and give us the output of that? Ideally as text in a code block (see the </> icon in the upper part of the text edit box) and not a picture.

Should I paste it to pastebin or 0x0.st or paste it here?

Pasting here is nicer, otherwise it goes out of date and is silly to open. Discourse makes nice scrollbars even for big files if you put them in a code block, and this one will be like 6 lines.

this path will be fetched (0.01 MiB download, 0.04 MiB unpacked):
  /nix/store/90143n70hv5wnv80yy20d45wa47lyc89-stdenv-linux
copying path '/nix/store/90143n70hv5wnv80yy20d45wa47lyc89-stdenv-linux' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.72, NixOS, 22.11 (Raccoon), 22.11.20221012.f634d42`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(root): `"nixos-22.05"`
 - channels(dibusure): `"nixpkgs"`
 - nixpkgs: `/home/dibusure/.nix-defexpr/channels/nixpkgs`

here we go

Hmmm, something’s fishy. Compare:

Those should match afaik.

Might also be causing problems. How exactly did you install nix-index? Did you use nixos-rebuild switch and reboot, or just nixos-rebuild build?

So
I use home-manager to install nix-index
programs.nix-index.enable = true;
I have this problem during a few days and i rebooted my laptop 2 times as minimal

I changed the version in configuration.nix and home.nix. It didn’t helped; root channels have not changed, they are still 22.05. How can I change root channel?

I tried vpn it hepled

1 Like

Could you elaborate on the vpn a bit ? How did it help ?

My pc can’t get the files from cache.nixos.org with WEB error. Vpn helped

For reference, system.stateVersion is never supposed to be changed. It just marks the version you installed NixOS on, so that upstream knows for backwards compatibility. I suggest reading through the description of that option there.

sudo nix-channel --remove nixpkgs
sudo nix-channel --add 'https://nixos.org/channels/<channel>' nixpkgs

where that <channel> is one of the names here: https://channels.nixos.org/

You typically want one of:

  • https://nixos.org/channels/nixos-22.05
    • Or whichever version is currently stable
  • https://nixos.org/channels/nixpkgs-unstable

After that you just need a sudo nix-channel --update and a sudo nixos-rebuild <switch/boot>.

I’d also recommend doing the same for your user, i.e., without sudo. The user’s channels don’t necessarily match the system channels, and that may cause issues, especially when using home-manager. You can run with unstable on your user and stable on your OS, but you will run into breakage sooner or later.

This is odd, because it makes me wonder how you even got NixOS installed in the first place. But oh well, good that it’s sorted.