edit
I have started an announcements page for further discussion if anyone is interested.
Well actually I’ve been working on just such a project using the new flakes feature. There is a damn solid skeleton in place that makes getting up and running simple. The README.md could tell you more about the directory heirarchy, but you should be able to do everything you asked much simpler now. In addition, every custom package, overlay and module declared are automatically bundled into the flake output for use in external configurations. Oh, and I flakified home-manager
and wired it up to be included in every configuration by default!
If you start a nix-shell in the base directory, it will automatically set up and pull in an experimental version of nix that supports flakes so you can get up and running quickly. I even have a simple command line script rebuild
in the shell which will take the place of nixos-rebuild for now.
It should be as simple as a:
# from project root directory
nixos-generate-config --show-hardware-config > ./hosts/<preffered-hostname>.nix
# flakes are vcs based so a brand new file must at least be staged for it to be contained in the flake
git add ./hosts/<preffered-hostname>.nix
rebuild <preferred-hostname> test
in the nix-shell to deploy a bare bones config to your current hardware. From there simply drop your current configuration in a subdirectory of profiles
and import it from the hosts/<preferred-hostname>.nix
. It’s great for getting up and running imediately, then you could start porting your configuration to match the ideals of the directory structure to keep concerns neatly separated.
In fact I was considering writing an RFC to include what I have as part of the NixOS organization on GitHub. I feel having a standardized and sane directory structure for configurations would go a long way for ease of sharing and contribution. I could actually really use some feedback, or any ideas that could possibly make it better!