current

Dendrtic Pattern

English | 简体中文

The Dendritic pattern is a way to organize Nix configurations, where each Nix file is a flake-parts module. I use the Dendritic pattern to combine NixOS and Home Manager configurations, avoiding the issue where configuration items spanning two configuration systems are located in different places.

Module Architecture

ModuleDescription
flakeModules related to flake-parts, including generating configuration from modules and some configuration items spanning NixOS and Home Manager
hostsNixOS and Home Manager modules for all managed hosts
coreCore NixOS and Home Manager configuration modules
desktopDesktop environment NixOS and Home Manager configuration modules
devDevelopment environment NixOS and Home Manager configuration modules, assumed to be for desktop
servicesAll NixOS modules running as services
usersNixOS modules recording all users

Where to Start

Start with the flake module, specifically the module that generates outputs.nixosConfiguration. Then, check each host’s ./hosts/<hostname>/default.nix to see which modules are referenced, and finally review each module in turn.

Anything Else?

Of course! Here are some real-world Dendritic pattern NixOS configurations I have seen (listed alphabetically):