I tried that, but it failed in the same place. You said Exec format error
could be due to a corrupted file, so I tried nix-store --delete /nix/store/xhz3ybvfn5s1qiza4fijd2l05cfd6082-nix-2.3.9/bin/nix --ignore-liveness
, which resolved that particular error. There were other packages with similar errors (some ELF errors, which I assumed were the same problem). After doing that for several more packages that were giving me similar errors, nix-build -A system '<nixpkgs/nixos>' --repair
was successful!
However, when attempting to run nixos-rebuild switch --upgrade
one last time, the same error appears:
{18:18}~ ➭ nixos-rebuild switch --upgrade
unpacking channels...
error: syntax error, unexpected $end, at /nix/store/scd85qqipci9mf80vi42xg547x7wqr4z-env-manifest.nix:1:1
error: program '/nix/store/1hxgccnj93j33xap44v1dzzb24ly1m2r-nix-2.3.7/bin/nix-env' failed with exit code 1
And so I attempted to do the same with nix-store --delete /nix/store/scd85qqipci9mf80vi42xg547x7wqr4z-env-manifest.nix
… and it worked! nixos-rebuild switch --upgrade
now works perfectly fine.
Thank you so much @shlevy! And thank you @turboMaCk and @NobbZ!
I really appreciate everyone’s help here. NixOS and the NixOS community are absolutely amazing.