Repository navigation
Generate the module and configuration types of every integration - #148
Merged
Merged
Conversation
`mkIntegration` builds `lib.caisson.<integration>.types` from the name and the class of the integration, as it builds `mkModule` from the class. `types.module` is the `deferredModule` type of nixpkgs, and it refuses a module that states another class, by `_class` or by the key of a registry entry. `types.configuration` takes what the `mkConfiguration` of the integration returns, and it refuses a configuration of another integration when the configuration is finalized. An alt integration carries the types of its owner. `caisson.<integration>.configurations` takes entries of that configuration type, so the refusal names the option and the file that define the entry. The option types of the core module move from `lib.caisson.flake-parts.types` to `lib.caisson-core.types`. 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.
mkIntegrationnow buildslib.caisson.<integration>.typesfor every integration from its name and its class, as it buildsmkModulefrom the class. No integration adds anything for it.types.moduleis the option type of a module of the class. It is thedeferredModuletype of nixpkgs, and it refuses a definition whose module states another class. A module states its class with_class. A module read from the registry states it in its key,modules.<class>.<name>@<project>. A function or a path states no class, and the type takes it unchecked.types.configurationtakes what themkConfigurationof the integration returns, or a deferred configuration. When the configuration is finalized, the type reads thetypeof its manifest and refuses a configuration of another integration. It forces nothing more of the manifest.nixos-minimal,home-manager-minimal) carries thetypesof its owner.caisson.<integration>.configurationsis now a lazy attribute set of that configuration type. A configuration of the wrong integration fails at the option, and the message names the option and the file of the definition:The option types of the core module (
libOverlay,pkgOverlay,libOverlays,pkgOverlays,manifest) move fromlib.caisson.flake-parts.typestolib.caisson-core.types. Theintegrationsoverlay of caisson adds them to that namespace. caisson-core is written on builtins alone, and an option type is built on the library of nixpkgs, so caisson-core itself needs no change.No repository in the workspace, topside or the site reads
lib.caisson.flake-parts.types. The site documents it, and nix-caisson/nix-caisson.github.io gets its own PR.Evaluation cost on ch-personal-machines, with every caisson pin of its lock overridden to caisson main and then to this branch (
NIX_SHOW_STATS). Both evaluations produce the samedrvPath.Each evaluation allocates about 65,000 more thunks, 0.12 % of the toplevel. The CPU times differ from run to run by more than they differ between the branches, on a machine with a load average near 6.
nix-caisson/topside#11 updates the topside goldens, which list the names of each namespace. nix-caisson/nix-caisson.github.io#93 updates the reference.
nix flake checkpasses locally, VM checks included.🤖 Generated with Claude Code