aboutsummaryrefslogtreecommitdiffstats

enstate

State next to the Nix store: keys, passwords, and public data about other hosts, which move forward only and change without deploying a system. A system declares what state it can consume; a receptor on the host accepts a snapshot that fits, puts it in place and reloads what uses it, or rejects it.

The design is in docs/design.md; docs/migrations.md walks through its migration model, and docs/comparison.md compares enstate with sops-nix, agenix, Clan and others; docs/examples.md shows how to move from sops-nix or agenix, with the common deployment tools.

What there is

enstate, one program for the receptor and the provider:

  • --plan PATH, --apply PATH: what the submission in PATH would do, and doing it: complete and partial submissions, items required and optional, groups, removal, the chain as order, validators (a type's and across slots), views and their reactions;
  • --stage PATH: a submission for the generation of --schema, before switching to it (a host's first one, too): the snapshot only, no views, no reactions;
  • --migrate [--dry-run]: first the submissions waiting in STATE/incoming/, then serving a generation from snapshots accepted under another schema (same names, renamedFrom both ways, kept entries), refusing where a required slot can't be filled;
  • --status, --materialize: the snapshots, what waits in the incoming directory and what the switch refused (with why; --status exits with 1 if something needs attention: a refused submission, one waiting that the running generation would refuse, an unfilled required slot), and putting every view in place; --forget NAME: a waiting or refused submission;
  • --pack PATH --out DIR: a submission from a source list, JSON or TOML; --pack PATH --dry-run [--json]: what keeps it from one, every problem by channel and slot, with location and variables, writing nothing.

Settings come from /etc/enstate/config.json if it exists, then --config files, then arguments.

The NixOS module is nix/module.nix; default.nix has the package and the module's VM test (nix-build -A tests.vm).

Bash completion is share/bash-completion/completions/enstate, which the package installs.

Validators and renderers run in a sandbox, by bubblewrap (the setting sandbox, none for none).

Not yet: converters, derived slots and steps.

cargo build
cargo test
enstate --help