Closed Khenziii closed 1 month ago
This was actually happening because of Nix's philosophy.
Nix is fully functional, so an action should have no side-consequences; we refer to this as purity.
To keep flakes pure, they should only require theirs inputs to build, nothing more. I was importing ./hardware-configuration.nix
, which was .gitignored
, so Nix was reasonably giving me errors. My previous setup could lead to a build being successful on one machine, and unsuccessful on another.
A lot of community members have criticized this behavior for it's unclear motives & I partially agree, the error should be more descriptive. Throwing a random "File Not Found" error is definitely not sufficient.
This issue has been resolved by explicitly informing Nix that this flake is impure, which is okay in our case (we obviously can't VCS hardware-configuration.nix
).
The Issue
For some reason, rebuilding using this command:
Fails, because of "missing"
hardware-configuration.nix
:This issue, seems to get resolved after removing / renaming the
.git
folder:Solution
I have genuinely 0 idea on why this might happen. Why does Nix even care to look at the content of .git?
If I won't figure out anything in the next couple days, I'm probably going to start a thread on Nix's discourse.
Until then, we'll be just renaming the .git directory..