Repository navigation
Record what each evaluator received as declaration events - #126
Merged
Merged
Conversation
… events Every configuration manifest now has a `history` (caisson-core), and caisson fills it with a `declaration` event for each module the evaluator of the configuration received, in that order: - the module list of the ecosystem, as a single event, such as `nixos` from `nixpkgs: nixos/modules/module-list.nix`; - caisson's framework module, `caisson.<class>`, and the other modules caisson adds, such as `caisson.nixos.pkgSet`; - each module selected from the registry, by its registry key, such as `modules.nixos.default`, with the project that registered it; - a module given as a path, by its path, and any other module as `inline/<index>`, with the file it names. To know which registry entry a selected module is, `lib.caisson.modules` now hands out each registered module inside a module keyed `modules.<class>.<name>@<project>`. The module system imports the modules that share a key once, so a registry entry an evaluation selects twice is imported once. The project is part of the key so that entries of the same name in different registries stay apart, such as a local `default` of the tree and caisson's own, which the integrations read from caisson's closure. Each integration's `evaluate` returns `modules`, the list it handed its evaluator, with an `ecosystemUnit` where the ecosystem's module list goes. `inEcosystem` makes those units for the integrations that name the ecosystem's modules by their files (hjem, nixvim, topology). caisson is pinned to the caisson-core branch that adds `history`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on nix-caisson/caisson-core#51, merged, which gives every configuration manifest a
history. This branch pins caisson-core to main, which has it.caisson fills each configuration's history with a
declarationevent for each module its evaluator received, in that order. For the NixOS configuration of the pinned-world machine, the events are:nixosnixpkgs: nixos/modules/module-list.nix(NixOS' module list, a single event)caisson.nixoscaisson: modules/nixos/coremodules.nixos.caisson/corecaissonmodules.nixos.caisson/defaultcaissoninline/4caisson.nixos.pkgSetKeys.
lib.caisson.modulesnow hands out each registered module inside a module keyedmodules.<class>.<name>@<project>, so an evaluation knows which registry entry each module is. The module system imports modules that share a key once, so a registry entry an evaluation selects twice is imported once. Before, it was imported twice, which either failed or doubled its list definitions. The project is part of the key because the same name can be registered by different projects in the registries an evaluation reads. The tree has a localhome-manager-activationin a unit test, and caisson's integrations add their own through caisson's closure. Without the project in the key, the module system would drop one of them silently.Integrations. Each integration's
evaluatereturnsmodules, the list it handed its evaluator, withecosystemUnit { key; project; file; }where the ecosystem's module list goes: NixOS, nix-darwin, home-manager, nvf, nixidy, system-manager, terranix, flake-parts and treefmt-nix.inEcosystemmakes those units for hjem, nixvim and nix-topology, whose lists name the ecosystem's modules by their files. The other integrations evaluate only caisson's modules and the configuration's.Files. A file inside a source in the Nix store is written relative to that source, such as
modules/nixos/core. A module registered throughprojectshas no file yet, because registration doesn't record one. caisson-core's own registry events have no file for modules either.Tests.
aMachineRecordsWhatItsEvaluatorReceivedchecks the sequence above, its origins and indices, and that a home-manager configuration inside the machine has the machine's childless history as its prefix and adds events after it.lib.caisson.modulesdirectly now look inside the keying module.nix flake checkpasses locally, including the VM tests and the evaluation-cost gate.The docs are in nix-caisson/nix-caisson.github.io#81.
🤖 Generated with Claude Code