dendritic-nix

Organize multi-class Nix configurations into flake-parts modules by feature.

8|Updated Dec 16, 2008
One-click install
npx skills add https://github.com/sebnow/configs --skill dendritic-nix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dendritic-nix
Source: https://github.com/sebnow/configs/tree/main/home-manager/agentic/skills/dendritic-nix
Command: npx skills add https://github.com/sebnow/configs --skill dendritic-nix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use the Dendritic Pattern to organize Nix configurations by feature across multiple classes, ensuring every file is a flake-parts module and reducing cross-class duplication.

Core Features & Use Cases

  • Each file in ./modules/ is a flake-parts module, enabling feature-centric organization across NixOS, home-manager, nix-darwin, and related targets.
  • Values are shared through let bindings and flake-parts options rather than specialArgs, ensuring clean, predictable merges.
  • Use cases include multi-host setups where a single feature spans NixOS, home-manager, and darwin configurations, with automated imports and consistent module merging.

Quick Start

Add a feature file under modules/ and wire it to all classes via config.flake.modules.

Frequently Asked Questions about dendritic-nix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize Nix configurations by feature across NixOS, home-manager, and nix-darwin?

Organize Nix configurations by placing each feature in a separate flake-parts module file under modules/, using the deferredModule type to merge contributions across NixOS, home-manager, and nix-darwin classes. This structure reduces cross-class duplication while maintaining predictable merges.

What is the Dendritic Pattern for structuring Nix flakes?

The Dendritic Pattern structures Nix flakes by feature rather than class, ensuring every file is a flake-parts module. A top-level flake.nix imports these modules using import-tree, allowing a single feature to span multiple hosting configurations.

How do I share Nix module values across classes without using specialArgs?

Share Nix module values across classes by using let bindings and flake-parts options instead of specialArgs. This approach ensures clean, predictable merges when configurations are combined via the deferredModule type.

Can I use flake-parts to manage multi-host NixOS and home-manager setups?

Yes, flake-parts manages multi-host setups by treating each file in the modules directory as a module. Automated imports wire features to all classes via config.flake.modules, enabling shared configurations across NixOS, home-manager, and darwin targets.

How do I add a new feature to a multi-class Nix configuration?

Add a new feature by creating a feature file under the modules/ directory and wiring it to all target classes via config.flake.modules. The top-level flake.nix automatically imports it using import-tree, integrating it into the existing NixOS, home-manager, or darwin setup.

What are the limitations of using deferredModule for Nix configuration management?

Using deferredModule for Nix configuration management requires adherence to flake-parts module architecture and import-tree for file loading. It is specifically designed for feature-based organization across NixOS, home-manager, and nix-darwin, meaning configurations outside this ecosystem are not supported.