[BREAKGLASS] Declarative infra + NixOS modules for CLAWTINATOR hosts.
Go to file
2026-01-07 21:51:04 +01:00
.github/workflows Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
clawdinator Initial CLAWDINATOR infra + NixOS scaffolding 2026-01-07 00:08:18 +01:00
docs Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
infra/opentofu Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
memory Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
nix Set clawdinator ownership for secrets 2026-01-07 20:53:22 +01:00
scripts Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
.gitignore Add S3 image pipeline and CI 2026-01-07 17:55:43 +01:00
AGENTS.md Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
CLAWDINATOR-SOUL.md Initial CLAWDINATOR infra + NixOS scaffolding 2026-01-07 00:08:18 +01:00
devenv.nix Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00
flake.lock Bump nix-clawdbot and codify no-inline-scripting 2026-01-07 12:08:06 +01:00
flake.nix Add S3 image pipeline and CI 2026-01-07 17:55:43 +01:00
README.md Switch pipeline to AWS AMI and remove Hetzner path 2026-01-07 21:51:04 +01:00

CLAWDINATORS

CLAWDINATORS are maintainergrade coding agents. This repo defines how to spawn them declaratively (OpenTofu + NixOS). Humans are not in the loop.

Principles:

  • Declarativefirst. A CLAWDINATOR can bootstrap another CLAWDINATOR with a single command.
  • No manual host edits. The repo + agenix secrets are the source of truth.
  • Latest upstream nixclawdbot by default; breaking changes are acceptable.

Stack:

  • AWS AMIs built in CI (nixos-generators + import-image).
  • NixOS modules configure Clawdbot and CLAWDINATOR runtime.
  • Shared hivemind memory stored on a mounted host volume.

Shared memory (hive mind):

  • All instances share the same memory files (no perinstance prefixes for canonical files).
  • Daily notes can be perinstance: YYYY-MM-DD_INSTANCE.md.
  • Canonical files are single shared sources of truth.

Example layout:

~/clawd/
├── memory/
│ ├── project.md # Project goals + non-negotiables
│ ├── architecture.md # Architecture decisions + invariants
│ ├── discord.md # Discord-specific stuff
│ ├── whatsapp.md # WhatsApp-specific stuff
│ └── 2026-01-06.md # Daily notes

Secrets (required):

  • GitHub App private key (for shortlived installation tokens).
  • Discord bot token (per instance).
  • Anthropic API key (Claude models).
  • AWS credentials (image pipeline + infra).

Secrets are stored in ../nix/nix-secrets using agenix and decrypted to /run/agenix/* on hosts. See docs/SECRETS.md.

Deploy (automationfirst):

  • Prefer image-based provisioning for speed and repeatability.
  • Host config lives in nix/hosts/* and is exposed in flake.nix.
  • Ensure /var/lib/clawd/repo contains this repo (needed for selfupdate).
  • Configure Discord guild/channel allowlist and GitHub App installation ID.

Image-based deploy (Option A, recommended):

  1. Build a bootstrap image with nixos-generators:
    • nix run github:nix-community/nixos-generators -- -f raw-efi -c nix/hosts/clawdinator-1-image.nix -o dist
  2. Upload the raw image to S3 (private object).
  3. Import into AWS as an AMI (aws ec2 import-image).
  4. Launch hosts from the AMI.
  5. Re-key agenix secrets to the new host SSH key and sync secrets to /var/lib/clawd/nix-secrets.
  6. Run nixos-rebuild switch --flake /var/lib/clawd/repo#clawdinator-1.

CI (recommended):

  • GitHub Actions builds the image, uploads to S3, and imports an AMI.
  • See .github/workflows/image-build.yml and scripts/*.sh.

AWS bucket bootstrap:

  • infra/opentofu/aws provisions a private S3 bucket + scoped IAM user + VM Import role.

Docs:

  • docs/PHILOSOPHY.md
  • docs/ARCHITECTURE.md
  • docs/SHARED_MEMORY.md
  • docs/POC.md
  • docs/SECRETS.md
  • docs/SKILLS_AUDIT.md

Repo layout:

  • infra/opentofu/aws — S3 bucket + IAM + VM import role
  • nix/modules/clawdinator.nix — NixOS module
  • nix/hosts/ — host configs
  • nix/examples/ — example host + flake wiring
  • memory/ — template memory files

Operating mode:

  • No manual setup. Machines are created by automation (other CLAWDINATORS).
  • Everything is in repo + agenix. No adhoc changes on hosts.

nix-clawdbot integration

Role: CLAWDINATORS own automation around packaging updates; nix-clawdbot stays focused on Nix packaging.

Automated flow:

  1. Poll upstream clawdbot commits (throttled to max once every 10 minutes).
  2. Update nix-clawdbot canary pin (PR).
  3. Wait for Garnix build + pnpm test.
  4. Run live Discord smoke test in #clawdinators-test.
  5. If green → promote canary pin to stable (PR auto-merge).
  6. If red → do nothing; stable stays pinned.