Getting error: .... path not valid for gnugrep-3.11 on nixos-rebuild switch

Consistently getting error: path '/nix/store/52k8rqihijagzc2lkv17f4lw9kmh4ki6-gnugrep-3.11-info' is not valid while running nixos-rebuild switch --upgrade.

I tried collecting garbage and rerunning multiple times even without upgrade, tried removing coreutils collecting garbage and rerunning, but nothing seems to solve it. I would very much like to not reinstall the whole thing. Any help is very much appreciated!!

Here is my configuration.nix.

Im on the unstable branch.

1 Like

Yes, I’ve been having the same issue since this morning. I’ve not been able to work around it yet.

i ran nixos-rebuild switch --repair and it seems to fix this issue.

1 Like

Yea, this is a bug in Nix 2.18: error: path is not valid using nix 2.18.0 · Issue #9052 · NixOS/nix · GitHub

Only nixUnstable has been updated to 2.18 though, so you if you set nix.package = pkgs.nixUnstable, that’s why you’re experiencing this. Shouldn’t happen if you remove that and let it use the default Nix version.


Thanks, lolwierd, worked lika charm!

1 Like