nix-index icon indicating copy to clipboard operation
nix-index copied to clipboard

`nix-index` fails due to `mesos` not being found

Open OleMussmann opened this issue 2 years ago • 4 comments
trafficstars

The package comma fails for me, because nix-index can't, well, index anymore. I'm not sure if nix-index is choking, or if nix-env is to blame.

$ nix-index
+ querying available packages
error: querying available packages failed
caused by: nix-env failed with error: nix-env failed with exit code 1:
error: attribute 'mesos' missing

       at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/development/haskell-modules/configuration-nix.nix:143:24:

          142|     # Pass _only_ mesos; the correct protobuf is propagated.
          143|     extraLibraries = [ pkgs.mesos ];
             |                        ^
          144|     preConfigure = "sed -i -e /extra-lib-dirs/d -e 's|, /usr/include, /usr/local/include/mesos||' hs-mesos.cabal";
       Did you mean one of meson, ecos, geos, less or memo?
(use '--show-trace' to show detailed location information)
$ nix-index --version
nix-index 0.1.5
$ nixos-version --json
{"nixosVersion":"22.11.20230524.99fe1b8","nixpkgsRevision":"99fe1b870522d6ee3e692c2b6e663d6868a3fde4"}

OleMussmann avatar May 26 '23 21:05 OleMussmann

I was having this issue, because I was using Nix flakes without updating the Nix channels.

This problem happens because nix-index expects an updated <nixpkgs> channel.

I fixed this issue by syncing the NIX_PATH with the current version of my nixpkgs input (from flake.nix):

{
  nix.nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
}

Note that you also need nix.channel.enable to be true (the default)

shiryel avatar Aug 10 '23 22:08 shiryel

I am also getting this error. Aren't flakes a replacement for channels? Why are they still needed for this?

e-nikolov avatar Aug 31 '23 21:08 e-nikolov

I am also getting this error. Aren't flakes a replacement for channels? Why are they still needed for this?

Flakes are an experimental feature, they are no replacement to channels today except if you know what you are doing.

RaitoBezarius avatar Aug 31 '23 21:08 RaitoBezarius

I just wasn't aware that it's possible to use channels when using flakes. I got started with flakes directly and have never used channels.

e-nikolov avatar Aug 31 '23 21:08 e-nikolov