aboutsummaryrefslogtreecommitdiffstats

rigging

Layers for rigs: roles for its NixOS guests, and the tools that come with them.

  • configs/claude.nix: Claude Code, as Remote Control servers (or interactive sessions), one per remote, each a context of its own in ~claude/remotes/NAME, on repositories they share in ~claude/src; and scheduled tasks for them (claude -p, by systemd timers). Needs rigs' layers/nix.nix below it, and --home. configs/claude/rsync-filter: what of /home is worth a backup.
  • configs/rust.nix: cargo, clippy, rustfmt, and what crates' build scripts commonly need.
  • configs/hermes.nix: Hermes Agent, with Claude as its model.
  • modules/claude-code.nix: Claude Code, for the layers that use it.
  • pkgs/claude-remote.nix: claude-remote, the guest's root's tool for the remotes (start, stop, attach, rename, schedule, …).
  • pkgs/claude-request.nix: claude-request, the remotes' requests for what only the host's user can do (a build on the host, a deploy, …), kept until answered; configs/claude/skills/claude-request, the skill that tells the remotes how.
  • pkgs/claude-inbox.nix: claude-inbox, the host's view of what the remotes have done: their branches, and taking them to master; and of what they've asked for: their requests, and answering them.

Each file starts with a comment on what it does, and how.

Use

A layer goes into a guest's layers, on top of rigs' own, e.g., in a checkout of rigs next to one of rigging:

nix-build pkgs/run-rig --arg base '[ base/kernel.nix ]' \
  --arg layers '[ layers/nix.nix ../rigging/configs/rust.nix ../rigging/configs/claude.nix ]'

Or, with flakes, by rigs' lib.runRig and rigging's nixosModules (claude, rust, hermes, claude-code); claude-inbox is rigging's package:

packages.x86_64-linux.claude = rigs.lib.runRig {
  pkgs = nixpkgs.legacyPackages.x86_64-linux;
  base = [ rigs.nixosModules.kernel ];
  layers = [ rigs.nixosModules.nix rigging.nixosModules.rust rigging.nixosModules.claude ];
};

Then, once, in the guest, as root: runuser -l claude -c 'claude auth login', and claude-remote --start NAME for a first remote.

The tools take their commands as options, in any order with their other options and operands, have help in sections (-h), and bash completion.