Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What commit, confirm and save do

A configuration change reconciles running services without rebuilding or rebooting the OS.

Apply a reversible change

set system hostname branch-a
compare
commit-confirm 2

Run these in a configuration session with a saved baseline. Verify management access from a second session, then confirm before the timer expires and save.

stateDiagram-v2
  [*] --> Candidate: set / delete
  Candidate --> Candidate: compare
  Candidate --> [*]: discard
  Candidate --> Running: commit
  Candidate --> Trial: commit-confirm N
  Trial --> Running: confirm
  Trial --> Saved: timer expires, saved baseline reapplied
  Running --> Saved: save
  Saved --> [*]: survives reboot

Choose the correct operation

OperationEffect
compareInspect pending changes before applying.
commitApply to running services. A future boot still reads the saved file.
commit-confirm NApply provisionally for N minutes, with a saved baseline for recovery.
confirm, then saveCancel the CLI rollback timer, then persist the running configuration.
discardDrop candidate edits that have not been committed.
rollback NApply and persist an archived revision. 0 is the newest.

State and privilege boundaries

TopicRule
What reads showThe last successfully applied snapshot (the saved file before the first live commit), not an open session's candidate. A stale candidate must not overwrite a newer applied snapshot.
Offline editing--no-apply requires an explicit configuration file.
Piped inputStops on the first refusal; it does not undo earlier successful commits.
API batchesValidated before the provisional transaction opens.
CLI vs APIThey share the compiler, not one transaction journal. CLI commit does not save; an API provisional apply persists its trial under its own recovery protocol. Do not infer one interface's persistence behavior from the other.

A local read-write group grants administrator access, including passwordless sudo. Read-only and ordinary ungrouped users do not receive it; the explicitly configured, ungrouped built-in admin is a bootstrap exception. Account removal or demotion terminates existing sessions and jobs. Keep an independent administrator or recovery console.

Recover a partial apply

Sentinel compiles the candidate before applying it and serializes concurrent applies. The firewall, routing and hostname stages track undo actions. A later service-stage failure can leave a mixed state: read the failure, retain console access and restore a known saved revision. See the operator walkthrough.

Validate in a VM

nix build .#checks.x86_64-linux.commit -L

This check verifies live apply and persistence across reboot.