Repository navigation
Give configurations their nearest children's defaults - #135
Merged
Merged
Conversation
…ults A default a level adds through caisson.forChildren reaches every configuration of its class beneath the level, at any depth. The deployment options of a colmena node, the file systems of a disk layout and the hardware of a facter report reached the machines declared inside a node, a layout's machine or a report's machine too. caisson.forNearestChildren.extraDefaultModuleImports.<class> adds to the defaults of the nearest configurations of that class beneath the level, through configurations of other classes, and no deeper. The default account records such an addition with nearest = true. The default modules of caisson-colmena, caisson-disko, caisson-facter, facter and topology give their NixOS modules this way. The parent modules of home-manager and hjem stay in forChildren, since they resolve their machine themselves. lib.caisson.integrations.belongsHere type entry says whether no configuration of the type lies between a level and an entry passed up to it. caisson-colmena's nodes are the NixOS configurations that belong to the colmena configuration, so a NixOS configuration declared inside a node is no node, and a node beneath a disk layout still is. caisson-core is pinned at 992db52, the branch of nix-caisson/caisson-core#56, which this change needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
caisson.forChildren.extraDefaultModuleImports.<class>reaches every configuration of that class beneath the level, at any depth. Most of what a level gives says what the configurations directly beneath it live on, and that stops being true one machine further down. A NixOS configuration declared inside a colmena node inheritedcaisson/colmena-deploymentand became a node. A machine inside a disk layout's machine inherited the layout's file systems. A machine inside a facter report's machine took the report's hardware as its own.The option.
caisson.forNearestChildren.extraDefaultModuleImports.<class>is a peer of theforChildrenfield with the same type. An addition made through it joins the defaults of the nearest configurations of that class beneath the level, passing through configurations of other classes such as a disk layout or a structural group. The configurations beneath those do not inherit it. The default account records such an addition like any other, with its key, level and file, plusnearest = true. An instance'smoduleImportsreset drops it like any default. The lifecycle side is nix-caisson/caisson-core#56.Moved to it:
caisson/colmena-deployment, given by caisson-colmenaThe parent modules of home-manager and hjem stay in
forChildren, since each resolves its machine itself throughnearest.Which configuration an entry belongs to.
lib.caisson.integrations.belongsHere type entryis true when no configuration oftypelies between a level and an entry passed up to it. caisson-colmena'snodesOfkeeps the NixOS configurations that belong to the colmena configuration, so a NixOS configuration declared inside a node is no node, and a node beneath a disk layout still is. The upstream-compatiblecolmenabuilds its hive through the same code.Tests:
nixosConfigurationsInsideANodeAreNotNodescovers a node beneath a structural group and a disk layout. The node has deployment options. A NixOS configuration inside it, and one inside a plain node, are not nodes, have no deployment options and get no layout file systems. All of them are still published.forNearestChildrenConnectsOncechecks that a nearest addition reaches the machines through a group and a layout but not the machines nested in them. It also checks that aforChildrenaddition still reaches every depth, and checks the account's entries.belongsHere. No existing expectation changed.Locally these pass: the pinned-world suite, nix-unit (200/200),
nix flake check --no-build, eval-weight, argument-errors, treefmt and drift-message. caisson-core is pinned at8f60ad7, the merge of caisson-core#56 on main, whose tree is the same as the branch these checks ran on. Every workspace consumer passesnix flake check --no-buildagainst this branch.🤖 Generated with Claude Code