Skip to content

Integrate deploy-rs for codified remote deploys#696

Merged
genebean merged 2 commits into
mainfrom
feat/deploy-rs
Jul 19, 2026
Merged

Integrate deploy-rs for codified remote deploys#696
genebean merged 2 commits into
mainfrom
feat/deploy-rs

Conversation

@genebean

Copy link
Copy Markdown
Owner

Summary

  • Adds deploy-rs (nix run .#deploy-rs -- .#<host>) for build/copy/activate remote deploys with automatic rollback if the new generation breaks SSH connectivity - covers all six NixOS hosts plus mightymac, invokable from any machine that can reach the target over SSH
  • Fixes a pre-existing, unrelated bug found while testing this: nixos-rebuild switch hanging/failing on dbus-broker.service's broken reload (upstream systemd/dbus-broker#37515) - now excluded from both reload and restart on switch fleet-wide
  • Documents both in README.md and AGENTS.md

Test plan

  • nix flake check --all-systems passes
  • --dry-activate verified against every node before a real deploy
  • Real deploy + confirmed magic-rollback on all 7 nodes: bigboy, mightymac, nixnuc, hetznix01, hetznix02, kiosk-entryway, kiosk-gene-desk
  • Post-deploy health checked on each host (systemctl is-system-running, dbus-broker/dbus.socket active)

🤖 Generated with Claude Code

https://claude.ai/code/session_018iUoDbZzHLBGu7jD3pVGz2

genebean and others added 2 commits July 19, 2026 17:11
dbus-broker's unit is Type=notify-reload but never sends the
RELOADING=1/READY=1 handshake systemd expects, so any switch that
touches its config hangs for the full 90s timeout and fails the whole
activation (upstream systemd/dbus-broker#37515). Restarting instead of
reloading isn't safe either - switch-to-configuration's own remaining
steps talk to systemd over D-Bus, so stopping dbus-broker mid-switch
can strand the activation script and leave the bus down until a manual
restart, as happened on nixnuc. Leaving it untouched by every switch
(neither reload nor restart) avoids both failure modes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018iUoDbZzHLBGu7jD3pVGz2
Adds deploy-rs: a declared deploy.nodes table plus `nix run .#deploy-rs --
.#<host>` for build/copy/activate, with automatic rollback if the new
generation breaks SSH connectivity. That safety net matters most for
kiosk-entryway and kiosk-gene-desk, which have no keyboard normally
attached and would otherwise need a physical visit to recover from a bad
deploy.

Covers all six NixOS hosts plus mightymac. Every node builds itself
(remoteBuild = true), so a deploy can be invoked from any machine that can
reach the target over SSH, not just mightymac - kiosk-gene-desk's own
existing distributedBuilds offload to hetznix02 handles its weak hardware
regardless of which machine runs the deploy. Hostnames resolve via
Tailscale MagicDNS, so no domain is hardcoded anywhere in this repo.

mightymac needed two additions to actually be deployable: a scoped
passwordless-sudo rule for deploy-rs's two non-interactive sudo command
patterns (nix-darwin has no wheelNeedsPassword-style toggle like NixOS),
and deploy-rs's own activate.darwin support wired through
lib/mkDeployNode.nix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018iUoDbZzHLBGu7jD3pVGz2
@genebean
genebean merged commit 8fe4d1c into main Jul 19, 2026
2 checks passed
@genebean
genebean deleted the feat/deploy-rs branch July 19, 2026 21:21
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