Skip to content

feat(aws-nixos): rebuild NixOS from a hidden provisioner agent - #1223

Draft
phorcys420 wants to merge 1 commit into
mainfrom
phorcys/aws-nixos-dual-agent
Draft

phorcys420 wants to merge 1 commit into
mainfrom
phorcys/aws-nixos-dual-agent

Conversation

@phorcys420

Copy link
Copy Markdown
Member

Experiment: split the aws-nixos boot into two agents.

amazon-init starts a root provisioner agent as a transient systemd unit. Its NixOS rebuild script runs the flake rebuild and then starts the main agent, also on failure. The provisioner stays connected (a disconnected agent marks the workspace unhealthy) and sits on its own hidden terraform_data resource, ordered after main.

  • Rebuild logs are native agent logs, so the hand-rolled log.sh pusher is removed.
  • A failed first boot still leaves a root shell: coder ssh <ws>.provisioner.
  • CLI users now have to pick an agent (<ws>.main).

Not yet tested on a real deployment: agent-to-resource attachment, hidden-resource UX for the rebuild logs, and nixos-rebuild switch leaving the transient unit alone.


Agent-assisted with Xum using Claude Opus 5.5.

A root provisioner agent, started by amazon-init as a transient unit,
runs the rebuild as a coder_script and then starts the main agent. The
rebuild logs are native agent logs, so the custom log pusher is removed,
and a failed first boot still leaves a reachable root shell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant