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.
| Library | What it provides | Documented on |
|---|---|---|
| gen-prelude | Utility functions the other libraries share, with no dependency on nixpkgs.lib | Used by the other libraries |
| gen-identity | hashIdentity, the function that mints every content-derived identity | Kinds, Registries and Identity |
| gen-algebra | Layered records, comparable functions and either | Typed Configuration, Kinds, Registries and Identity |
| gen-types | Type checkers that each give a readable error | Typed Configuration |
| gen-merge | The module system: evalModuleTree, priorities, submodules and provenance | Typed Configuration, Inspection |
| gen-scope | The evaluator: node trees, attributes computed on demand, binding nodes and the rule solver | Evaluation, Rules, Kinds, Registries and Identity |
| gen-memo | Incremental rebuild: reuse, early cutoff, and a trace of what was reused | Incremental Rebuild, Inspection |
| gen-graph | Graph queries over your own data: reachability, ordering, cycles and label path queries | Graphs and Queries |
| gen-bind | Argument injection into module functions, and the terminals content is delivered to | Typed Configuration, Delivery |
| gen-schema | Kinds with typed options, and registries of their instances | Kinds, Registries and Identity |
| gen-aspects | Aspects: declaration, key categories, guards and graph facts | Aspects |
| gen-select | Selectors that match nodes by kind, attribute and position | Graphs and Queries |
| gen-dispatch | Rules applied step by step as typed actions | Rules |
| gen-product | Graph products, such as hosts × users | Graphs and Queries |
| gen-settings | Settings resolved against ordered override layers, with provenance | Typed Configuration |
| gen-link | Aspect graphs federated from several flakes | Aspects |
| gen-view | Views that move content along edges, name resolution and schedule checks | Delivery, Evaluation |
| gen-program | Logic programs built from rule declarations, and their models | Rules |
| gen-delivery | Projecting each node’s class content and realising it through terminals | Delivery |
| gen-class | Sharing one computed core across nodes of the same shape | Incremental Rebuild |
| gen-assemble | One node set assembled from many contributions | Evaluation |
| gen-inspect | Queries, explanations and diagrams over a built graph | Inspection |
| gen-rules | The one place a closure is applied: closures lowered to first-order nodes and rules, and the rule patterns | Rules |
Taking one library or all of them
Section titled “Taking one library or all of them”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.
Palettes adapted from Catppuccin (Macchiato) (MIT), Tokyo Night (Apache-2.0), gruvbox (MIT), Catppuccin (Latte) (MIT), Rosé Pine (Dawn) (MIT).