NAR info file is corrupt

When running a package or rebuilding the system in NixOS, I get an error message stating that the NAR info file is corrupt.

$ nix run nixpkgs#htop
error: NAR info file 'zmsj741l5kz90v81x7h8i1fvj3pnjjb4.narinfo' is corrupt
$ sudo nixos-rebuild switch
building the system configuration...
error: NAR info file 'jdfp9wvvjiwi97jrj8hnwrx1zcl7hw1b.narinfo' is corrupt
(use '--show-trace' to show detailed location information)

I have tried removing ~/.cache/nix on both user and root, resulting in the same error.

hmmm,

what does

curl https://cache.nixos.org/zmsj741l5kz90v81x7h8i1fvj3pnjjb4.narinfo

give you?

do you have any other sources of nars apart from cache.nixos.org?

1 Like