Thank you for taking the time to write this and share publicly. As desktop Linux users are flocking to NixOS it is valuable they are exposed to patterns to choose from that make sense to them.
It is definitely the best Flake framework and it is simply out of this world!
Simplify the user interface for defining a host machine
I want this as well.
Create a Nix starter template to help newcomers to adopt this approach.
I would like to thank Shahar “Dawn” Or (mightyiam) for pioneering this approach. My repository is inspired by his work.
I really liked this writeup! I’ve been working on my own refactor as well that has a lot in common with what you’re doing!
Currently, I have a module system that lets you define configs for nixos, home, and darwin. The modules are imported, and the config is split into separate nixos, home, and darwin modules and imported as needed. I don’t use feature tags, but do enable different modules by default based on systems tags like workstation, gaming, laptop, etc.
This system works pretty well for the most part, but there’s some weird stuff going on with imports, I think because of conditional imports not being allowed. Using flake-parts modules should fix that. Thanks for sharing!
Do you have a link to your repo?
Sure, it’s currently not entirely functional or documented in the slightest. I’m also using nilla and npins atm instead of using flakes.
The library for the modules is here: quasigod/unify: A framework for unifying multiple types of Nix configurations, allowing you to easily define them in the same modules. - Codeberg.org
And this is the configuration using it: Making sure you're not a bot!
Both have out of date readme’s and no docs atm. The config is able to build, but I’m not super happy with the structure atm. For example, the imports.nix file which handles all the imports to avoid issues with conditional imports. I’m in the middle of finals week atm, but after it, I hope to clean a lot of it up.