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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "switch"
}
}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 | |||