What is the Dendritic Pattern?
masterThe Dendritic Pattern is a Nixpkgs module system usage pattern designed to provide a practical and expressive architecture for Nix configurations (NixOS, home-manager, nix-darwin, etc.).
In this pattern, every Nix file (except for entry points like default.nix or flake.nix) is treated as a module of a single top-level configuration. This top-level configuration facilitates the declaration and evaluation of lower-level configurations.
Key characteristics:
- Single Feature Focus: Each top-level module implements a single feature across all configurations it applies to.
- Path-based Naming: The file path serves to name the feature.
- Module Storage: Lower-level modules (NixOS, home-manager, etc.) are stored as option values within the top-level configuration.
- Value Merging: Uses the
deferredModuletype to allow multiple lower-level module values to merge under a single name.