Skip to content

feat: add the topology, kubenix and nixidy integrations - #101

Merged
clhodapp merged 5 commits into
feat/nixvimfrom
feat/topology-kubenix-nixidy
Oct 18, 2026
Merged

clhodapp merged 5 commits into
feat/nixvimfrom
feat/topology-kubenix-nixidy

Conversation

@clhodapp

@clhodapp clhodapp commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Adds the last three survey integrations, caisson.topology (over nix-topology), caisson.kubenix and caisson.nixidy. It also has the cost fix that makes room for them. This PR is based on #100. Merge #94 through #100 first, then change the base of this PR to main.

The cost fix

perf(core) declares the export settings of every class, caisson.modules.<class>.export.enabled and .exported, in a single option, caisson.modules. It is an attribute set by class of plain values (lazyAttrsOf (lazyAttrsOf raw)). Before, there were two options for every registered class in every evaluation. Now a class no module sets costs nothing to evaluate.

  • Definitions are written the same way as before. Priorities on exported still take effect.
  • Two definitions of exported for one class now conflict instead of merging. No module in caisson or in the workspace defines it twice.
  • A class with no registered module, or a key other than export and exported, is refused when the exports are read.
  • I tried submodules first, but each submodule is an evaluation of its own, and the gate on module-system evaluations refused them.

The fix took caisson's overhead in the eval-weight check from 4.07 MB to 3.66 MB. With the three integrations added it is 3.83 MB. The ceiling is still 4.28 MB.

Each integration still costs about 60 KB through caisson-core's composition. caisson-core merges every overlay's result into the library with acc.prev // result, so each overlay copies the accumulated library once in every composed library. Removing that cost would mean changing caisson-core, and this PR doesn't.

The integrations

  • topology:
    • A topology configuration is the diagram of the NixOS configurations declared inside it. Those machines get nix-topology's NixOS module by default.
    • caisson evaluates nix-topology's topology modules on the composed library, on the selected package set extended with nix-topology's packages, with nixosConfigurations set to the machines at its system.
    • The configuration named default is published as topology.<system>, where nix-topology's flake module publishes it.
    • The test declares two machines inside a topology configuration. The nodes, and the derivation of the rendered diagram, match nix-topology's own evaluation over the same machines evaluated with its NixOS module.
  • kubenix:
    • caisson makes the evaluation kubenix's evalModules makes, on the composed library extended with upstreamables.nix, with the same kubenix argument.
    • The configuration is published as kubenixConfigurations.<system>.<name>, its evaluation. Its config.kubernetes.result is the JSON that kubectl apply -f reads.
    • The test checks that it is the derivation kubenix's evalModules gives the same module.
  • nixidy:
    • caisson calls nixidy's own mkEnv with the composed library as lib, and adds the composed library's namespaces through mkEnv's libOverlay.
    • The configuration is published as nixidyEnvs.<system>.<name>, which the nixidy CLI reads.
    • mkEnv returns no options, so, as with terranix, a nixidy configuration holds no configurations beneath it.
    • The test checks that the environmentPackage derivation is the one mkEnv renders from the same module.

Checks

  • nix flake check passes.
  • All 18 workspace consumers pass nix flake check --no-build with this branch in place of both caisson pins. Consumers that set caisson.modules.<class>.exported, such as ch-ai-workbench and ch-emacs-config, are among them.

🤖 Generated with Claude Code

clhodapp and others added 5 commits October 18, 2026 10:59
Every evaluation declared `caisson.modules.<class>.export.enabled` and
`caisson.modules.<class>.exported` as options for every registered
class. `caisson.modules` is now one option, an attribute set by class
of the two settings, so a class no module sets costs nothing to
evaluate. The definitions are written as before; a class with no
registered module, or a setting other than the two, is refused when the
exports are read. `exported` is now a value, so two definitions of it
for one class conflict instead of merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A topology configuration is the diagram of the NixOS configurations
declared inside it. caisson evaluates nix-topology's `topology` modules
on the composed library and the selected package set extended with
nix-topology's packages, with `nixosConfigurations` set to the machines
declared inside it at its system; those machines get nix-topology's
NixOS module by default. The configuration named `default` is
published as `topology.<system>`, where nix-topology's flake module
publishes it.

A kubenix configuration is Kubernetes resources written as kubenix
modules, evaluated as kubenix's `evalModules` evaluates them, on the
composed library extended with kubenix's `upstreamables.nix`. Its
`result` is published as `packages.<system>.<name>`.

A nixidy configuration is an Argo CD environment, evaluated with
nixidy's own `mkEnv` over the composed library, with the namespaces of
the composed library added to nixidy's through `libOverlay`. It is
published as `nixidyEnvs.<system>.<name>`, which the nixidy CLI reads.

The pinned-world suite checks each against its upstream evaluator: the
same topology nodes and diagram, the same kubenix result and the same
nixidy environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A configuration with `perSystem` has an evaluation for each system in
force; the comments called it "evaluated at a system", which names one
of those evaluations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A configuration is published as `kubenixConfigurations.<system>.<name>`,
the evaluation kubenix's `evalModules` returns, whose
`config.kubernetes.result` is the JSON `kubectl apply -f` reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comments of the integrations said a configuration is evaluated at
every system in force, and one in the integrations library said a
configuration is evaluated at a system. They say it is evaluated per
system, once for each system in force.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clhodapp
clhodapp force-pushed the feat/topology-kubenix-nixidy branch from 407657e to 67e6c70 Compare October 18, 2026 18:04
@clhodapp
clhodapp merged commit 825a72c into main Oct 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant