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.