Little bit nicer please? People here answer questions in their own time because they like helping out, no need for sarcastic responses to a reply trying to be helpful. You can just honestly say it’s above your head for now.
That said, taking a step back, nix flakes in general try really hard to provide “reproducibility”, i.e., make sure that if you have the same source everybody building it will be able to get the same results.
As part of ensuring this, nix will copy all files in your project to /nix/store before building, so that each and every path referred to in your nix project has a canonical nix store path to resolve.
This makes lots of features possible, like the evaluation cache. You can find more about it in this issue.
The downside is that nix needs to copy all your files to the nix store. This can be slow, and for that reason, when you use a git repository, nix will only copy the files that git tracks.
This means that any files that git is unaware of (i.e., have never been git add ed before) will not be copied. It’s not enough for the file to show up as untracked when you run git status, it must show up in the unstaged or staged changes (or be in a commit already).
As a side effect, you will also be unable to build any changes not part of the repository yet. This can be nice because you won’t accidentally forget to push a file, resulting in a broken upstream. But it does result in lots of newcomer confusion.
There’s some ongoing work to improve things around this feature too. I don’t think it will solve the tracking problem you have, but it will solve a lot of the other problems this causes. Personally I think the merging of that PR might mark the date when flakes become usable for a general audience.
As for the terminology you’re currently lacking:
All files that your build will at some point try to access
Reading all the .nix files, and figuring out what they mean before running the various tasks you ask nix to do. Similar to compilation, but not compilation, because instead of the output being machine code it’s just essentially instructions for what nix is going to do.
If your flake.nix is in a git repository, nix infers that you’re using git to track your project files, so it turns on the features I described. This can especially trip up people who e.g. put their entire home directory in a git repo, of which there are surprisingly many.
The explicit way of telling nix about your project being in a git repo is by using the git: uri scheme in your inputs to refer to a project. If you use path: instead, nix will skip any git-specific functionality.
Whatever type is set to in the input, see the docs. The uri “scheme” (i.e. the text before :) expands to the type. Hence the “schema/type”, depending on whether you use the uri or the expanded form.
I think “Schema” is the German spelling. Not sure though, schema/scheme have overlapping meanings in English.
I’ll check this part out because even though I ran the command in a non-empty directory, all the files there should have been in git.
My desillusionment is I think because I did the Zero to Nix thing and it showed me a bunch of what amounts to really magic tricks but didn’t really explain anything and now I feel dumber than I did before.
A lot of the explanations above feel like:
All told, a monad in X is just a monoid in the category of endofunctors
That classic bit is jargon explicitly designed to be exclusive. Maybe the jargon in Nix doesn’t have the same intention, but the result is the same.
That makes sense but I had not gotten at all the notion that it would copy the entire project contents to /nix/store. Whether it copies everything or a selection based on some convention I guess is secondary.
So yeah, that seems to be the issue.
I add the flake.* to git and now nix develop does do something.
In that new shell, I can’t build my project because Security is missing. I add pkgs.darwin.apple_sdk.frameworks.Security to the packages but adding them to buildInputs works too. Now it builds.
What I don’t get though is that buildPhase does not do anything. It just says: no Makefile, doing nothing
I thought that this was a Rust flake (?)? Shouldn’t buildPhase run cargo?