Repository navigation
Conversation
A nixops4 configuration declares its machines as NixOS configurations beneath it and the module of the NixOps4 root component as component. Each machine becomes a member of the root, an exec resource of the local provider of NixOps4 that copies the toplevel and runs bin/apply over SSH, with the SSH settings nixops4-nixos declares. The component module sets them, from resource outputs where needed. The root is built with mkRoot from the library file of NixOps4 imported over the composed library, the deploy shell comes from the selected package set for the deploying system, and the configuration named default is published as the nixops4 output. The default module of the class gives the machines the new nixops4-apply NixOS module, which imports the apply module of nixops4-nixos. The check that a machine is one evaluation moves from caisson-colmena into the integrations library, so both integrations share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
Contributor
Author
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.
Adds
caisson-nixops4, the native NixOps4 integration.A nixops4 configuration declares the machines NixOps4 deploys as NixOS configurations beneath it, under
caisson.nixos.configurations.<name>, and the module of the NixOps4 root component as the optioncomponent. Each machine becomes a member of the root component under its name. The member is anexecresource of thelocalprovider of NixOps4. It copies the machine's toplevel to the host withnix copyand runsbin/apply switchover SSH, as the NixOS resource of nixops4-nixos does. The member declares the SSH settings of that resource under the same names (ssh.host,ssh.user,ssh.hostPublicKey,ssh.opts,copy.substituteOnDestination,sudo.enable). Thecomponentmodule sets them, and it may set them from the outputs of other resources. A machine is evaluated by caisson before NixOps4 runs, so the NixOS modules of a machine cannot read resource outputs.How the root is built:
nix/lib/lib.nixfrom the NixOps4 source over the composed library and calls itsmkRoot. It does not use thelibthat the NixOps4 flake builds over its own nixpkgs.defaultPkgs), for that system.localprovider asproviders.localunless thecomponentmodule declares one under that name.defaultis published as thenixops4flake output, which the NixOps4 command reads. The machines are published asnixosConfigurationsfrom the same evaluation.The default module of the class adds a new NixOS module,
nixops4-apply, to the machines. It imports theapplymodule of nixops4-nixos, which buildsbin/apply, from the source pinned or declared asnixops4-nixos.The root refuses a machine name that NixOps4 cannot address (empty, or containing
.). It also refuses a machine evaluated for more than one system. That check moves from caisson-colmena intolib.caisson.integrations.evaluatedMoreThanOnce, so both integrations use it.tests/dependenciespins nixops4 and nixops4-nixos. The pinned-world suite has six new probes: the root end to end, the apply script on machines, SSH settings taken from a resource output, the deploy shell from the selected set, unaddressable names, and the ecosystem record. I checked that a broken expectation makesnixops4RootEvaluatesEndToEndfail by name.pinned-worldand every other x86_64-linux check pass locally, except the three VM tests, which I did not run.The upstream-compatible
nixops4integration is not part of this pull request.Docs: nix-caisson/nix-caisson.github.io, branch
docs/caisson-nixops4.🤖 Generated with Claude Code