This is an automated archive made by the Lemmit Bot.

The original was posted on /r/nixos by /u/cacrawford on 2024-03-22 17:24:09.


link:

This is the setup I use for configuring my own Nix and non-Nix systems. I’ve recently migrated it to the module system and externalized it so that others may use it as well. It does provide some nice defaults for those interested in

The main issues I was looking to address with this setup were:

  1. Flake-based configurations. Flakes aren’t extraordinarily complicated but I thought it wasn’t necessarily intuitive how to get a NixOS/home-manager configuration into a flake – this makes it a bit more intuitive but keeps it customizable.
  2. Multi-host setups. This configures hosts with the module system, so users can define their own host attributes and use them to customize their NixOS/home-manager configurations.
  3. Joint configurations. I didn’t like how my configurations for stuff like emacs would end up in three separate files, so this combines nixpkgs/home-manager/NixOS configurations in one place.
  4. Tag-based enabling/disabling of applications – so that you can categorize apps using tags (such as gui, music, gaming, development etc) and then configure hosts to use all apps with these tags.

Curious on what others think about it. I sort of abused the deferred modules type in the Nix module system… but it does demonstrate some cool applications here. If you want to see this in action, check out my personal dotfiles at .