Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> your flake is not committed or staged

That has nothing to do with flakes. When I add a "module" to my repos its the same. I have to add it the git repos or nix does not "see" it. And yes, its pretty unintuitive.



It actually is specific to flakes. Classic nix commands can see untracked files just fine. Flake evaluation behaves differently because of how it decides which "scheme" to use:

> If the directory is part of a Git repository, then the input will be treated as a `git+file:` URL, otherwise it will be treated as a `path:` url;

This is why untracked or unstaged files disappear when using flakes:

https://github.com/NixOS/nix/blob/ec6789f9dafce41011418fe6fc...


Interesting.


What's more interesting, is how confident your original comment read, but turned out to not be correct at all. Of course it has always been true, but excellent reminder that even humans hallucinate.


I tried to edit my comment but not possible.

I could have sworn that I had this issue without using flakes. The start with Nixos was really bumpy; I must have mixed something up.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: