Add --headless mode (no stdin read, runs until SIGTERM/exit) + systemd/NixOS examples
ci / check (push) Successful in 2m44s

This commit is contained in:
Sausage Agent
2026-10-18 15:24:20 +00:00
parent c204e1ef0c
commit 01a821ab72
7 changed files with 144 additions and 9 deletions
+15
View File
@@ -48,6 +48,21 @@ From a clone (`git clone https://gitea.surma.technology/surma/sausage`), the
same commands are `nix run`, `nix run -- init`, `nix run -- run` and
`nix run .#loop`.
### As a service (headless)
Without a terminal (systemd, a container), stdin is `/dev/null` and EOF would
stop the world. `--headless` (or `SAUSAGE_HEADLESS=1`) turns the console
input off: the host runs until SIGTERM/SIGINT (clean stop, exit code 0) or a
broker `exit` request (exit code 75, so the loop starts the newest version).
Create the world first (`init`), then run the loop:
```sh
nix run git+https://gitea.surma.technology/surma/sausage#loop -- --headless my-world
```
[`examples/systemd/`](examples/systemd/) has a plain systemd unit and a NixOS
module that run exactly this.
In the console:
```text