skip to content

Libraries

gen is 22 libraries, each its own repository at github:sini/gen-<name>. The hub, github:sini/gen, pins all of them and hands them to you as one set. The documentation is organised by feature, so this table tells you which pages cover each library.

LibraryWhat it providesDocumented on
gen-preludeUtility functions the other libraries share, with no dependency on nixpkgs.libUsed by the other libraries
gen-identityhashIdentity, the function that mints every content-derived identityKinds, Registries and Identity
gen-algebraLayered records, comparable functions and eitherTyped Configuration, Kinds, Registries and Identity
gen-typesType checkers that each give a readable errorTyped Configuration
gen-mergeThe module system: evalModuleTree, priorities, submodules and provenanceTyped Configuration, Inspection
gen-scopeThe evaluator: node trees, attributes computed on demand, binding nodes and the rule solverEvaluation, Rules, Kinds, Registries and Identity
gen-memoIncremental rebuild: reuse, early cutoff, and a trace of what was reusedIncremental Rebuild, Inspection
gen-graphGraph queries over your own data: reachability, ordering, cycles and label path queriesGraphs and Queries
gen-bindArgument injection into module functions, and the terminals content is delivered toTyped Configuration, Delivery
gen-schemaKinds with typed options, and registries of their instancesKinds, Registries and Identity
gen-aspectsAspects: declaration, key categories, guards and graph factsAspects
gen-selectSelectors that match nodes by kind, attribute and positionGraphs and Queries
gen-dispatchRules applied step by step as typed actionsRules
gen-productGraph products, such as hosts × usersGraphs and Queries
gen-settingsSettings resolved against ordered override layers, with provenanceTyped Configuration
gen-linkAspect graphs federated from several flakesAspects
gen-viewViews that move content along edges, name resolution and schedule checksDelivery, Evaluation
gen-programLogic programs built from rule declarations, and their modelsRules
gen-deliveryProjecting each node’s class content and realising it through terminalsDelivery
gen-classSharing one computed core across nodes of the same shapeIncremental Rebuild
gen-assembleOne node set assembled from many contributionsEvaluation
gen-inspectQueries, explanations and diagrams over a built graphInspection
gen-rulesThe one place a closure is applied: closures lowered to first-order nodes and rules, and the rule patternsRules

The hub gives you every library at once:

genLibs = inputs.gen.lib.mkGenLibs { }; # genLibs.graph, genLibs.merge, …

Outside a flake, import <gen checkout> { } returns the same set.

A library also works on its own. Add github:sini/gen-<name> as an input and use inputs.gen-<name>.lib. Five libraries, gen-assemble, gen-delivery, gen-inspect, gen-program and gen-rules, publish .lib as a function of the libraries they build on, so you call it with those libraries first. The hub makes that call for you.

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).