Overalls.

An AI-first developer platform that you own.

Guide Self-host
Design Architecture
Source GitHub · MIT Appearance

Provision a host

The bootstrap tool, tools/buck2 run //:host, turns a rented server in rescue mode into a NixOS host that installs from a reviewed plan and then updates itself. It never trusts a new SSH key automatically and never formats a disk you haven't approved.

Commands
discover · plan · install · enroll · verify
Inventory
fleet/hosts/NAME/host.json and BUCK, plus an optional configuration.nix for roles

1. Discover

Get the rescue system's Ed25519 host key through a trusted channel and put it in its own known-hosts file. Then record what the machine has:

tools/buck2 run //:host -- discover --platform hetzner --name example \
  --target root@HOST --known-hosts /private/rescue-known-hosts \
  --identity /private/operator-key --output /private/example.candidate.json

Use --platform ec2 for EC2 bare metal. Discovery won't overwrite an existing file. It suggests a network configuration (DHCP on EC2, interface addresses on Hetzner) for you to review.

2. Review and declare

Copy the candidate to fleet/hosts/NAME/host.json and finish it by hand:

  • Set reviewed to true once you've checked the hardware, firmware and networking.
  • Choose storage.system by disk ID: two physical disks on Hetzner, or the existing root EBS volume on EC2. On EC2, list the local NVMe IDs in storage.guests.
  • Give identity.hostId a persistent, nonzero eight-digit hex value. Leave identity.sshKeys empty for now.
  • Set budgets.guestCpuCores, guestMemoryMiB and arcMaxMiB, and on Hetzner a reviewed storage.quotaBytes.
  • Set git.repository to your fork's SSH URL and add your Git server's known-host lines to git.knownHosts. Private keys never go in the declaration.

Add fleet/hosts/NAME/BUCK so the installer, enrollment tool and updater can build this host's targets:

load("@root//buck:fleet.bzl", "fleet_host")

fleet_host()

If the host will run Lilly, declare that role now (see enroll hosts), then commit and push to trunk. Planning only accepts a commit that has been pushed to trunk.

3. Plan

Use your fork's SSH URL for <repository-ssh-url>, matching git.repository in the declaration:

tools/buck2 run //:host -- plan --host example --revision FULL_COMMIT \
  --repository <repository-ssh-url> \
  --target root@HOST --known-hosts /private/rescue-known-hosts \
  --identity /private/operator-key --output /private/example.plan.json

The plan pins the declaration, the authenticated target key, the firmware, the revision, the exact system, disk-layout and kexec paths, and the list of disks it will erase. Read it. Everything is built before anything destructive happens.

4. Install

tools/buck2 run //:host -- install --plan /private/example.plan.json --erase PLAN_SHA256 \
  --target root@HOST --known-hosts /private/rescue-known-hosts \
  --identity /private/operator-key

The installer kexecs into a pinned image, compares the disk inventory again and formats under a lock. It refuses if a device is mounted or a pool is imported. The new host key is generated on the host; only its public half comes back, recorded in PLAN.installed.json. Keep that file. An interrupted install never resumes formatting silently.

5. Enroll and verify

Record the installed public key in identity.sshKeys and in a new known-hosts file. Add {"name":"example-git","path":"secrets/example-git.enc.json"} to credentials. Prepare a JSON document at /private/example-git.json, outside the checkout and Nix store, readable only by you. Its structure is:

{"overalls-git":{"production":{"GIT_DEPLOY_KEY":"<complete SSH deploy key>"}}}

Use the complete read-only deploy key, with its line breaks encoded as JSON string escapes. Encrypt the document to the authenticated host and recovery recipients:

tools/buck2 run //:secrets -- encrypt example-git --input /private/example-git.json

Push the updated declaration and ciphertext, then activate that exact commit and check it:

tools/buck2 run //:host -- enroll --host example --revision ENROLLED_FULL_COMMIT \
  --repository <repository-ssh-url> \
  --install-receipt /private/example.plan.json.installed.json \
  --target YOU@HOST --known-hosts /private/installed-known-hosts \
  --identity /private/operator-key
tools/buck2 run //:host -- verify --target YOU@HOST \
  --known-hosts /private/installed-known-hosts --identity /private/operator-key

YOU is your own account name from nix/policy/identity/users.nix. Remove the private plaintext document when encryption succeeds.

From here the host polls trunk every ten seconds, with jitter. Changes to the platform, firmware, disks or identity are rejected by ordinary updates; those need deliberate maintenance.

Full reference: docs/operations/host-provisioning.md