Every time I use #NixOS for something new I get a weird, inscrutable error message that I spend ages trying to work out. Every time it's because I've forgotten to `git add` something. There must be a better way?
@boffbowsh have you disabled the warning that Nix gives you when the git repo is dirty? It should be saying something like "warning: git working directory is dirty" if you have uncommitted (including untracked) changes.
My first course of action when things inexplicably explode is to make sure Nix can see all the files.
@jakehamilton I think once it's happened another 20 or 30 times I'll learn my lesson ;)
I do have that "tree is dirty" warning enabled, but I often test things without committing. The files only need to be in the staging area (`git add`), not necessarily committed to be used by Nix.
@boffbowsh idk i always get the same error that says file.nix doesn't exist when i forget to do git add
@boffbowsh it's one of the most annoying things about nix flakes, if it's in a got repo it needs to be committed
@boffbowsh note that you can use `git add -N filepath` (`-N` is short for `--intend-to-add`), to add the file under git tracking (the index), but without adding it to the staging area (used for next commit)
@boffbowsh devenv.sh fixes that :)
@boffbowsh one of the first things I do is build out a justfile (https://github.com/casey/just ) that supports my common workflows. Helps me remember and run the appropriate steps.
Don't use experimental features when they're not ready. All of this pain is likely caused by flakes.
@Atemu as someone new to Nix, I actually prefer the flakes experience otherwise. I really dislike this gatekeeping against flakes by keeping it in experimental. Large sections of the community seem to have embraced it.
@boffbowsh @Atemu yknow, maybe maybe Flakes are still experimental for a reason
Most of us "flake sceptical" people don't have anything against flakes conceptually. A sane standardised method of composing Nix projects would be *great* IMHO.
Flakes' current implementation just simply isn't ready to play that role yet. UX is one of the larger remaining issues and I sadly don't see it fixed any time soon.