switch
Activate NixOS or Home Manager configurations with optional dry-build validation, record rollback generation, and return units changed, package delta, systemd health, and generation before/after.
Instructions
Activate the configuration (sudo -n nixos-rebuild switch / home-manager switch). Records rollback_generation first. Returns a structured 'summary' (units changed, derivations built, package delta, systemd health, and a bounded warnings list from the captured switch log) plus gen before/after; on success the raw log is trimmed to a tail (pass full_log=True for all of it). Status is 'degraded' when activation succeeded but units newly failed. No implicit validation by default; pass validate=True to gate on check('dry-build') first. On a sudo auth failure returns a 'privilege' diagnosis. Local activation only; hosts requiring cluster cordon/drain and readiness gating must use their fleet orchestrator.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | nixos | |
| full_log | No | ||
| validate | No | ||
| flake_uri | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||