Stoker is a deploy system for nix that runs deploys on each host keeping a eval cache so that remote evals (from ci or wherever else) are much faster than usual. It is split up into a coordinator service, agent service, and local cli and has rollback similar to deploy-rs magic rollback.
Quick Start #
See examples/coordinator.toml, examples/agent.toml, and examples/github-deploy.yaml.
NixOS / nix-darwin Flake Modules #
{
inputs.stoker.url = "git+https://tangled.org/dunkirk.sh/stoker";
outputs = { nixpkgs, darwin, stoker, ... }: {
nixosConfigurations.coordinator = nixpkgs.lib.nixosSystem {
modules = [
stoker.nixosModules.coordinator
stoker.nixosModules.agent
{
services.stoker-coordinator = {
enable = true;
settings = {
repo_url = "https://github.com/your-org/your-nix-config.git";
auth = {
allowed_tags = [ "tag:deploy" ];
allowed_users = [ "you@example.com" ];
allow_all_tailnet_read = true;
};
nodes.coordinator = {
address = "coordinator:7421";
system = "x86_64-linux";
};
};
};
services.stoker-agent = {
enable = true;
settings.auth.allowed_nodes = [ "coordinator" ];
};
}
];
};
darwinConfigurations.mac = darwin.lib.darwinSystem {
modules = [
stoker.darwinModules.agent
{
services.stoker-agent = {
enable = true;
settings.auth.allowed_nodes = [ "coordinator" ];
};
}
];
};
};
}
CLI Usage #
export STOKER_COORDINATOR=coordinator:7420
stoker status
stoker diff
stoker deploy
stoker deploy --node edge-vps --rev main
stoker rollback edge-vps
stoker history --limit 10
Without the coordinator #
Agents fetch, evaluate, and build on their own, so a deploy does not need the coordinator to be up. --direct drives the agents straight from the CLI, and --fallback-direct does that only when the coordinator cannot be reached:
stoker deploy --fallback-direct --rev "$SHA" \
--nodes-file nodes.json --repo-url https://example.com/fleet.git --push-cache
The agents must allow the caller to write (auth.allowed_tags, say tag:deploy). With no evaluator on the caller, a direct deploy decides "unchanged" after the agent builds, cannot --dry-run, always offloads light nodes to their builder_fallback, and is not recorded in stoker history.
The canonical repo for this is hosted on tangled over at https://tangled.org/dunkirk.sh/stoker
ยฉ 2026-present Kieran Klukas