After doing a git reset to a commit that I know would build without problems, I get the following error:
; nix flake update # zsh
error:
… while fetching the input 'git+file:///home/me/src/my-nixos-conf'
error: getting working directory status: invalid data in index - calculated checksum does not match expected
I don’t know what your nix-super is, but I accidentally ran into this when using fleek.
I have a working git repo holding my flake that’s already in the local store. I reset one file to what it was in a prior commit and then create a new commit with the result, and my nix flake update is now throwing this same error.
error:
.. while fetching the input 'git+file:///home/{username}/.local/share/fleek'
error: getting working directory status: invalid data in index - calculatedd checksum does not match expected
I’ve tried deleting the repo and recloning it from the remote, but it doesn’t help. I’ve also tried resetting back to the commit that originally worked, and I still get the error. Nothing I do will let me get past the error, it doesn’t even seem to be related to the contents of the local repo anymore.
Is there some way to track down what nix store item was added for the local flake and forcibly remove it from the store? I assume that’s the fix here.
Ah, I just found nix store verify is even giving the same error. So somehow the flake being added to the store in the first place is what corrupted the nix store.
Now, after a complete uninstall and re-install of nix, I built my flake once, changed a file in the git repo, commited the change, and tried to rebuild it. And it caused the error.
When the error occurs, it doesn’t seem to be resolvable in any way short of completely uninstalling and re-installiung nix.