How about a heirarchy of functionality (for example GNOME shell config would go in desktop-environment/GNOME/shell.nix), using a tree of include
s, so there might be a include.nix
in every directory, which includes
all include.nix
one level down plus all other nix files in the current directory?
The list given by @jtojnar is very helpful for getting some inspiration. For directories, you typically have a top-level default.nix
which imports all .nix
files in the directory. You don’t need to type out default.nix
when importing the directory (./dir
implies ./dir/default.nix
).
Furthermore, you can define custom options that activate other configs. For example, my modules/desktop/default.nix
is always imported but it does nothing until I set zhaofeng.desktop.enable = true;
.