I’m not exactly sure if I have ca-derivations enabled but I’m pretty sure I do because these are derivation files that are causing issues. How would I disable them if I had to?
And yes, I’ve ran nix-store --repair --verify multiple times to no avail.
env-manifest.nix is not a derivation file. Derivation files end in .drv.
env-manifest.nix is used by nix-env to keep track of what you have installed. Have you tried cat-ing it just to see what’s actually broken about it? It’s possible some nix-env operation would fix it, but I avoid that command like the plague so I wouldn’t know for sure.
Presumably the file ended up empty for some reason, and just installing and then uninstalling something with nix-env will fix it. Maybe you need to delete the broken version first (but I don’t think your command does that).
I don’t think you can undo making your store content addressed. It’s an experimental feature, and you would have had to use nix store make-content-addressed at some point in the past, or set the contentAddressed config option on nixpkgs (and then noticed your system rebuilding software a lot more).
You would also have had to set experimental-features = ca-derivations in your nix config at some point for it to even allow you to do any of the above.
My point is, unless you are doing so on purpose, you almost certaily aren’t using ca-derivations.
Sorry to bump but I haven’t found a good answer to this one. I am having this exact issue on NixOS 23.05 right now; I’ve noticed it affects both nix-env and home-manager (which I use so I can update a small set of desktop applications separately from the system packages); I can’t change what user-level packages/derivations I have installed with either of these because of that completely empty nix-env manifest. Uninstalling, installing, upgrading, or even querying user-level packages with nix-env all hit that same error. Someone on Reddit said they resolved this using nix-env --rollback but unfortunately I don’t currently have any older generations to rollback to.