Rant
I overhauled my flake many times, but I pretty much always find myself in one of these situations:
- Importing everything with relative links, which break when files are moved (the initial versions of my flake)
- Defining options that can be used "anywhere" (the older versions of this flake), but:
- They still have to be imported, either from a global file, or with smaller default.nix files that just contain imports (making maintenance more annoying)
- I have to remember the options, and in the end I make it weirdly modular for nobody but myself to ever use it, even though I still have to edit the modules anyway when I want to change something which make them not that much modular
- I'm weirdly overriding the existing NixOS modules (which are already really well made) with my amateur settings
- It's only ever worth it for programs that don't have Home Manager and NixOS options (like searchix), in which case I can just make a fucking PR to nixpkgs anyway, so it's not worth it
- This can be seen in the ssh modules, which I am NOT proud of
- Something in between (at time of writing what the flake is organized like), with weird links here, auto module discovery there, and stupidly-made config queries in some files like the Traefik module which hurts my eyes the more I read it
Honestly and objectively speaking, my pain is rooted in trying to reinvent the wheel, or to create a custom system that nobody sane ever would use. I am trying to copy what the Nix pros are doing to give myself credit or to try to chase a programming level which is unatainable for me, I'm simply not that experienced.
Solution
And so I must scrape everything in a big refactor, and use the dendritic pattern.
The dendritic pattern (with flake-parts) would allow writing self-contained definitions of basically any type of derivation, and using anything anywhere in the flake.
Resources
Rant
I overhauled my flake many times, but I pretty much always find myself in one of these situations:
Honestly and objectively speaking, my pain is rooted in trying to reinvent the wheel, or to create a custom system that nobody sane ever would use. I am trying to copy what the Nix pros are doing to give myself credit or to try to chase a programming level which is unatainable for me, I'm simply not that experienced.
Solution
And so I must scrape everything in a big refactor, and use the dendritic pattern.
The dendritic pattern (with flake-parts) would allow writing self-contained definitions of basically any type of derivation, and using anything anywhere in the flake.
Resources