Somehow or other one of the files in my /nix/store/.links has been corrupted. I am running ZFS and discovered this by running sudo zpool status -v.
Is there some way for me to force nix to rebuild this file? Can’t find much about it online.
I understand that .links consists of hard links to files to deduplicate the nix store, and is created by nix-store --optimize. I was hoping that nix-store --optimize would then rebuild the file, but it doesn’t seem to.
Also, I cannot readlink the link because it is corrupted. So I don’t even know what it is. Hah!
Unfortunately nix-store --verify --check-contents --repair fails, presumably when it hits the broken file
Ok, that makes sense
Strangely this produced no results. (Although find did have some trouble looking into some directories, even with sudo. From what I can tell this is some further kind of corruption.)
I can say that not the entire file is corrupted, and I was able to look at large portions of it. From what I can tell it appears to be an ffmpeg binary. I don’t know if this is useful information really.
I think I might try nuking my /nix and rebuilding it off of a bootable USB using nixos-install
Well, I was able to rebuild /nix/store/.links by way of rebuilding my entire /nix. I wrote up the process here, and in case of link rot here’s the gist of it:
I booted into a NixOS installer USB, mounted my machine’s /nix to /mnt/nix, my machine’s /boot to /mnt/boot, and symlinked /mnt/etc/nixos/configuration.nix to my machine’s configuration.nix (which required another mount).