Deploy & rollback¶
Every change starts in the repository. Machines are never fixed by editing config directly on a host.
Validate before opening a PR¶
GitHub Actions CI is the authoritative build check. Local validation is still useful before opening a PR:
nix flake check --no-build
nix flake show --all-systems
Deploy¶
The normal deployment path is GitHub Actions:
- Open a PR.
- Wait for CI to build every host.
- Merge once the checks are green.
- Let CD switch
yggdrasil,midgard, andalfheim.
See CI/CD pipeline for the workflow details.
Explicit manual path¶
just test and just switch are break-glass/bootstrap commands. Run them only
when an operator explicitly asks for a local activation. Building and
activation still happen remotely on the target host.
just test <host> # activate without making it the boot default
just switch <host> # activate and set as boot default
Hosts: yggdrasil, midgard, alfheim.
Internally this runs:
nixos-rebuild <test|switch>
--no-reexec
--flake .#<host>
--build-host <host>
--target-host <host>
--sudo
manual test activation
When the explicit manual path is needed, just test activates a
configuration without making it the boot default. A configuration activated
with test disappears on reboot.
Rollback¶
Roll back to the previous generation on the host:
sudo nixos-rebuild switch --rollback
If the system no longer boots, pick the previous generation from the systemd-boot menu.
Caveats¶
- Never edit
flake.lockby hand; usenix flake update. system.stateVersionrecords initial-install defaults; do not bump it unless release notes explicitly say to.- Deploys touch live hosts: use CI/CD for normal changes, and run local
just test/just switchonly on explicit request.