skip to content

Which Tool for Which Job

Start from what you want to do. Each row names the mechanism that does it and the page that explains it.

you want touseread
ask which nodes relate to which, along certain kinds of edgea labelled path queryGraph, Graphs and Queries
bundle configuration and reuse it on several hostsan aspect, with includes for dependenciesFeatures, Aspects
declare what a host or user looks like, with defaultsa kind and a registryIdentity, Kinds, Registries and Identity
find out which file set a valueprovenance on the merge resultModule types, Typed Configuration
reject bad values with a clear messagea type, or a refined typeModule types
give a module the host or user it configuresargument injection with wrapArgument injection
derive relations from conditions, such as an access listrules solved as a logic programRules, Rules
compute a value per node from the node and its surroundingsan attributeOn demand, Evaluation
move settings along edges, with a clear winner when several applya viewDelivery
turn each host’s content into a NixOS systemdelivery to a terminalDelivery
re-evaluate quickly after an editcompose and overrideIncremental, Incremental Rebuild
see why an edge exists, or query the graph with SQLthe inspectorInspection

includes or a rule? Use includes when one feature always needs another: webserver always brings ssh. Use a rule when a relation depends on facts about the nodes: a webserver reaches a database only in the same environment and only while the database is up.

A query or a rule? A query reads the edges that exist. A rule adds edges. Run the rules first, then query the combined graph.

A merge priority or a view order? A merge priority decides between definitions of one option, such as the server’s own port against a default. A view order decides between contributions that arrive along different edges, such as a setting from the environment against one from the host.

An injected argument or an option? A module reads an injected argument and sets options. The host a module configures is an argument. The port it opens is an option.

An attribute or an option? An option is a value that modules define and gen merges. An attribute is a value gen computes at a node from an equation, often from the node’s position in the graph, such as a domain inherited from the environment above.

A name or an identity? A name is what you call a node. An identity is computed from the node’s kind and its definition. Two nodes of different kinds never share an identity, even when their names match, and an edit that changes a definition changes its identity.

palette
dark
light
↑↓ select↵ apply esc close

Palettes adapted from Catppuccin (Macchiato) (MIT), Tokyo Night (Apache-2.0), gruvbox (MIT), Catppuccin (Latte) (MIT), Rosé Pine (Dawn) (MIT).