Repository navigation
Carry defaults for the nearest children of a class - #56
Merged
Merged
Conversation
A default a level added through forChildren reached every configuration of its class beneath the level, at any depth. Most of what a level gives says what the configurations directly beneath it live on, which stops being true one machine further down. A configuration's evaluation may now return forNearestChildren.extraDefaultModuleImports by class. Each manifest carries nearestPending, by class, the additions on their way down. At a configuration of class C, the additions pending for C join its default after the inherited ones and connect there: inheritedFrom drops them before passing defaults on. Beneath a configuration, what is pending is what reached it, less its own class, followed by its own additions. mkConfiguration takes the configuration's class for this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clhodapp
added a commit
to nix-caisson/caisson
that referenced
this pull request
Oct 25, 2026
nix-caisson/caisson-core#56 merged, so caisson-core moves from its branch to the merge on main. 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.
A default that a level adds through
forChildrenreaches every configuration of its class beneath the level, at any depth. Most of what a level gives says what the configurations directly beneath it live on: the deployment options of a colmena node, the file systems of a disk layout, the hardware of a facter report. That stops being true one machine further down. A NixOS configuration declared inside one of those machines inherited them all.A configuration's evaluation may now return
forNearestChildren.extraDefaultModuleImports, by class. These additions connect at the nearest configurations of their class beneath the level and go no deeper:nearestPending: by class, a list of{ select; file; level; nearest = true; }, the additions on their way down.nearestPendingis what reached the parent, minus the parent's own class, followed by the parent's own additions. Systems and configurations with no class pass it on unchanged.defaultModuleImports.Cis what it inherits, followed bynearestPending.C.inheritedFromdrops entries markednearestbefore passing defaults down, so they stop at the configuration they reached.mkConfigurationtakesclass ? nullfor this. caisson passes the class of each configuration, so caisson must take this change before it passesclass.Tests: the new test
lifecycleNearestAdditionsConnectOncechecks that an addition reaches the nearest configuration of its class through a configuration of another class, and that a configuration of that class nested inside it does not inherit it. Locally,nix flake checkand the test summary (133 passed) pass.The caisson side, the option
caisson.forNearestChildrenand the defaults moved to it, follows in nix-caisson/caisson.🤖 Generated with Claude Code