Skip to main content

Crate consortium_nix

Crate consortium_nix 

Source
Expand description

§consortium-nix

NixOS deployment orchestration for consortium.

This crate provides the deployment pipeline for NixOS and nix-darwin systems, replacing colmena. It consumes fleet configuration (produced by the Nix library) and orchestrates the evaluate → build → copy → activate pipeline using consortium’s DAG executor for maximum parallelism with per-host pipelining.

§Architecture

The deployment pipeline has four stages, executed as a DAG:

For each host:
  eval(host) → build(host) → copy(host) → activate(host)

Stages run in parallel across hosts (up to concurrency limits), and each host can advance independently — host A can be copying while host B is still building.

Builder health checking (health) validates remote builders before use.

Re-exports§

pub use config::DeployAction;
pub use config::DeploymentNode;
pub use config::DeploymentPlan;
pub use config::FleetConfig;
pub use config::ProfileType;
pub use error::NixError;
pub use error::Result;

Modules§

activate
Profile activation — switch NixOS/nix-darwin systems to new configurations.
build
Nix build orchestration — build closures locally or with distributed builders.
cascade
Cascade closure-distribution primitive.
cascade_events
Cascade event protocol — fine-grained events emitted by the cascade coordinator as the run progresses.
cascade_executor
Production RoundExecutor implementations — wrap real nix copy subprocesses, runnable against actual nixlab hosts.
cascade_integration
Glue between the cascade primitive and the per-host fleet deploy.
cascade_strategies
Cost-aware cascade strategies built on petgraph.
cascade_trace
Trace recorder and exporters for cascade runs.
config
Configuration types for NixOS deployment.
copy
Closure copying — transfer built closures to deployment targets.
error
Error types for NixOS deployment operations.
eval
Nix evaluation — resolve toplevel store paths and detect changes.
health
Builder health checking — probe builders for SSH connectivity and Nix store access.
tasks
DagTask implementations for each NixOS deployment phase.

Structs§

DeployReport
Summary of a deployment run.

Functions§

deploy
Run the full deployment pipeline using the DAG executor.
deploy_with_cascade
Cascade-driven deploy: same eval/build/activate as deploy, but the per-host nix copy stage is replaced by a single whole-fleet cascade that distributes each toplevel peer-to-peer.