Skip to content

nest

nest models your fleet as a DOM and resolves configuration the way a browser resolves styles.

  • Infrastructure as a DOM: your fleet is an attrset hierarchy (environments, roles, regions); parents propagate scalar attributes to children, so system or env is set once and inherited
  • Traits over repetition: traits classify nodes and form dependency DAGs. needs pulls in dependencies (a server trait can pull nginx, ssh, firewall), and neededBy injects in reverse
  • Rules over inheritance: rules match nodes by selector and contribute NixOS (or other aspect oriented) module fragments. nest hands the collected list to nixosSystem, so lib.mkForce, lib.mkDefault, type checking, and conflict detection all work as usual
  • CSS selectors for targeting: match by trait, name, attribute, DOM ancestry, predicate, or boolean combination, with string syntax like #lb-prod, .nixos, [env=prod], prod > web
  • Synthesis for derived data: compute derived node attributes and inject virtual children that participate in rule matching like any other node

nest is the fleet and infrastructure layer. Because its rules emit ordinary NixOS / Aspect oriented module fragments, it composes with the rest of the ecosystem, a CSS-flavored way to target and assemble configuration across many machines.

Source Code Documentation Support this project