aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: d2a7117670f8f747c4fc73e76e4826fb343b9e2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 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/design.md);
[docs/migrations.md](docs/migrations.md) walks through its migration model,
and [docs/comparison.md](docs/comparison.md) compares enstate with sops-nix,
agenix, Clan and others; [docs/examples.md](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](nix/module.nix);
[default.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](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.

```sh
cargo build
cargo test
enstate --help
```