diff --git a/docs/demo.md b/docs/demo.md
index af1cc9d..98cde2c 100644
--- a/docs/demo.md
+++ b/docs/demo.md
@@ -40,6 +40,7 @@ flowchart TB
subgraph boxvm["Box VM"]
sshd["sshd, as box
(nodes web, router, vault, box)"]
+ cache["sshd, as cache
(the binary cache's store)"]
end
slop -- "vsock" --> broker
@@ -50,6 +51,7 @@ flowchart TB
shell -- "moves master" --> repo
broker -- "SSH, through a wrapper" --> builder -- "fetches" --> repo
broker -- "SSH, localhost:2222" --> sshd
+ broker -- "SSH, localhost:2222" --> cache
```
| Part | Where | Runs |
@@ -57,7 +59,7 @@ flowchart TB
| Broker, from this checkout (`cargo run`) | Host | `devenv up` (process `slop-broker`) |
| Web app | | Part of the broker |
| [Pocket ID](https://pocket-id.org), for approvers to sign in | | `devenv up` (process `pocket-id`) |
-| Box VM ([`box.nix`](../nix/demo/box.nix)): `sshd` for the targets, and the deploy target | `localhost:2222`, as `box` | `devenv up` (process `box`) |
+| Box VM ([`box.nix`](../nix/demo/box.nix)): `sshd` for the targets, the deploy target and the binary cache | `localhost:2222`, as `box`, and as `cache` for the cache | `devenv up` (process `box`) |
| Agents' VM ([`agent.nix`](../nix/demo/agent.nix)), signed in as `agent` | Your terminal | `demo` |
| The repository, seeded from [`repo/`](../nix/demo/repo) | `.devenv/state/slop-demo/git/repo.git` | `git daemon`, one per connection from the agents' VM |
| The builder (`slop-broker builder`, from this checkout) | Host | The broker, through its `ssh` |
@@ -81,8 +83,8 @@ CID are in [`settings.nix`](../nix/demo/settings.nix). The broker's configuratio
- `slop ssh vault` is denied.
- `slop secret keys` runs without asking; the other secret requests ask, with a 5-minute
lease, except reading, which asks every time.
- - Using the builder asks, with leases, except for commits already on `master`; deploys ask.
- There's no binary cache, so `slop build` says it isn't configured.
+ - Using the builder asks, with leases, except for commits already on `master`; deploys and
+ builds into the binary cache ask, with a 5-minute lease.
## Approving
@@ -167,6 +169,25 @@ profile). `demo-box cat /run/demo/version` on the host shows what's active.
The box VM lets `box` use `sudo` without a password and copy unsigned paths into its store, which
lives in memory, like everything else in the VMs.
+### The binary cache
+
+The box VM holds the binary cache's store, at `/var/lib/slop-cache`, owned by its `cache`
+account, as [`services.slop-broker-cache`](../nix/modules/nixos/cache.nix) sets it up: the
+broker's key may only run `nix-daemon --stdio` on that store and add GC roots. Nothing serves it
+to other boxes; it's for seeing what `slop build` pushes. In `~/repo` on the agents' VM:
+
+```sh
+slop build packages.x86_64-linux.default