When running the command nixos-rebuild list-generations
throws this error
building Nix...
error:
… while evaluating the attribute 'config'
at /nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: file 'nixos-config' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
How do I fix this? It is only happening on one of my machines. It was happening on my first NixOS machine and then it stopped and I cannot remember what might have resolved it.
Now it is happening on my second NixOS machine and I have no idea why.