Settings backend API
The org.enzimos.System1 D-Bus service that Settings uses for authenticated system changes — queries, durable jobs, authorization and error codes.
Settings changes most things directly through standard services, but operations that need root — backups, snapshots, updates, recovery, firewall trust, battery and memory policy — go through one authenticated backend: org.enzimos.System1.
| Bus | System bus |
| Bus name / object / interface | org.enzimos.System1 at /org/enzimos/System1 |
| Package | enzimos-backend-prototype (despite the name, this is the backend shipped in current development images); it pins an exact enzimos-native-policy release |
| Activation | D-Bus activated on first call; nothing starts it at boot |
| Source | crates/backend and crates/platform in the enzimos-packages repository |
Wire format
Every method takes and returns one JSON document in a D-Bus string. Requests are limited to 4096 bytes of strict UTF-8 JSON, with no duplicate fields. Errors are the D-Bus error org.enzimos.System1.Refused, whose message is a fixed public code. Caller identity always comes from the unique system-bus sender; UIDs, PIDs or "authorized" flags in the JSON are never trusted.
| Method | Purpose |
|---|---|
GetCapabilities() | Schema versions, available queries and operations. No authorization needed. |
Query(s) → s | Read-only status |
Operation(s) → s | Durable jobs that change the system |
Always gate features on GetCapabilities: older images do not provide every query or operation.
Queries
{"schema":1,"query":"history"}returns {"schema":1,"query":"history","result":{…}}. Queries use the polkit action org.enzimos.system.query, which is allowed without a password for the active local session and refused otherwise. The backend checks the session again before releasing the reply; a lock, session switch or disconnect withholds it.
| Query | Returns |
|---|---|
system | OS release, kernel, firmware type (uefi/bios), package versions, installed generations, current generation, recovery image readiness |
snapshots | Up to 100 newest root and home snapshots: number, UTC date, kind, description, cleanup |
backup-points | Up to 100 newest local backup points: id, time, completeness, size |
backup-candidates | Passive list of drives that could become a backup destination, with a selection token when eligible |
history | Home history on/off and state, snapshot counts, home retention policy |
backups | Whether local/remote backups and the schedule are configured, retention, last cleanup, destination availability, last backup, next run |
network-trust | The trusted firewall zone and each NetworkManager connection's zone |
memory-policy | Configured and effective memory protection mode, presets, service health |
power-policy | Configured critical battery action and supported actions |
Treat absent or null fields as unknown, never as zero or success. For example, destination_available: false means "not connected", not a query failure, and repository_bytes stays null because the backend never runs an expensive scan just to open Settings.
Operations
Operations are durable jobs with a four-step lifecycle:
{"schema":N,"operation":OP,"action":"plan"|"submit"|"status"|"cancel",
"request_id":"<32 hex, chosen by the app>","plan_sha256":null|"<64 hex>",
"allow_interaction":true|false,"selection":{…}|null}- plan with a
selection. The backend returns{"state":"planned","plan_sha256":…}. Show the plan to the user. - submit with that
plan_sha256. This is the only step that asks for an administrator password, through the polkit agent. - status — poll until
stateiscompleted(readresult),cancelledoruncertain. - cancel works only before the job starts.
plan, status and cancel are bound to the job's owner and the active local session and need no password. Allow at least 150 seconds for an interactive call, because the administrator prompt can take up to 120 seconds. A D-Bus timeout does not mean the operation failed: check status before doing anything else.
Every step of a running job re-checks that the approving user's session is still live, local and unlocked, so locking the screen stops it at its next step. The exception is backup-create: once started, a backup continues across lock and logout, like a scheduled one.
Settings operations
| Schema | Operation | Selection |
|---|---|---|
| 25 | network-trust-set | {"connection":"<NetworkManager UUID>","trusted":bool} |
| 26 | home-history-set | {"enabled":bool} |
| 27 | backup-schedule-set | {"enabled":bool} |
| 28 | battery-action-set | {"action":…,"risk_acknowledged":bool} |
| 30 | home-retention-set | {"hourly","daily","weekly","monthly","yearly","manual"} counts |
| 31 | backup-retention-set | {"automatic":bool,"last","daily","weekly","monthly","yearly"} |
| 32 | memory-policy-set | {"mode":"balanced"|"responsive"|"off","risk_acknowledged":bool} |
Backup, update and recovery operations
| Schema | Operation | Selection |
|---|---|---|
| 3 | backup-create | none — creates a new encrypted backup |
| 5 | update-apply | none — stages an update as a new generation; reboot to use it |
| 4 | recovery-prepare | {"birth","generation"} |
| 29 | own-file-restore | {"id","snapshot","path"} — restores a file as a new private copy |
Further operations cover file and folder restore exports, remote replication and retrieval, credential review and rotation, and boot retirement. The complete, ordered list is OPERATIONS in crates/platform/src/system_contract.rs, and each schema's selection is validated in crates/backend/src/system_selection.rs.
Rules for specific operations
- Network trust. A trusted connection uses the firewalld zone
enzimos-trusted, which allows local discovery such as mDNS and DHCPv6. The polkit action keeps its authorization briefly, so trusting a network right after connecting does not prompt twice. - Backup schedule. Turning it on refuses at
planwithjob-plan-changedwhen no backup destination is configured. - Battery action. Actions are
auto,suspend,hibernate,power-offandignore.suspendandignorerequirerisk_acknowledged: true; the others requirefalse. Suspend and hibernate are only offered when logind reports the capability. The setting applies at the next boot; the backend deliberately does not restart UPower. - Home retention. Each count is 0–1000,
manualat least 1, and the five timeline counts together 1–1000. New counts apply at the next scheduled cleanup. - Backup retention.
lastis 1–1000; the calendar tiers are 0–1000. Saving retention never starts a backup or prunes immediately. - Memory policy. Only
offrequires a risk acknowledgement. The backend replaces the configuration atomically, restarts the guard and verifies its arguments; a failed restart restores the previous configuration.
Manual home snapshots use the older Job method with schema 2:
{"schema":2,"operation":"home-history-create","action":"submit","request_id":"<32 hex>","allow_interaction":true}Memory protection policy
enzimOS ships earlyoom with a Balanced preset, alongside a zstd zram device. The memory-policy-set presets are:
| Preset | Available memory TERM / KILL | Free swap TERM / KILL |
|---|---|---|
| Balanced | 10% / 5% | 20% / 10% |
| More responsive | 15% / 8% | 40% / 20% |
Absolute caps keep large machines from giving up large amounts of usable RAM. Off skips the guard and leaves only kernel OOM handling and zram. The backend accepts no thresholds, process names or unit names; only these three modes. The desktop's own processes (compositor, shell, lock, portals and similar) are excluded from earlyoom selection by exact process name. This keeps the desktop available, but it is not a security boundary.
Error codes
| Code | Meaning |
|---|---|
not-authorized | Polkit or session check failed |
service-busy | Another job holds the worker; safe to retry after it ends |
job-plan-changed | State changed since planning; plan again |
job-plan-invalid, request-fields, request-version | Malformed request |
operation-unavailable | Not supported by this backend |
job-not-found, job-owner-mismatch, job-transition-refused | Job lifecycle errors |
backup-destination-absent | The backup drive is not attached |
backup-destination-not-mounted | The drive is attached but unmounted |
backup-destination-busy | A backup or other operation is using the drive |
backend-result-unknown-do-not-retry-automatically, internal-result-unknown-do-not-retry-automatically | Outcome unknown |
Details go only to the system journal (journalctl -u enzimos-backend-prototype), one bounded line per refusal. Replies never contain paths, credentials or command output.
Services Settings talks to directly
These areas do not go through System1:
| Area | Service |
|---|---|
| Wi-Fi and Ethernet | NetworkManager |
| Bluetooth | BlueZ |
| Battery | UPower |
| Power profiles | power-profiles-daemon |
| Firmware updates | fwupd |
| Time, locale, hostname | systemd-timedated, localed, hostnamed |
| Disks | udisks2 |
| Sound | PipeWire / WirePlumber |
| User accounts | AccountsService |
They use their own polkit rules. Administrators are members of wheel.
Other enzimOS services consumed by Settings include org.enzimos.Developer1 (developer tools), org.enzimos.DevMonitor1 (ports, processes and containers), org.enzimos.Background1 (background apps) and the shared app-permissions worker; see App permissions and Store internals.
Writing a client
A few rules every client of System1 should follow:
- Read capabilities first and hide features the backend does not advertise.
- Send each mutation once, then observe. Never replay after a lost reply or
uncertainresult; do a fresh read and let the user decide. - Closing a window or losing the connection does not undo a committed change, and cancellation only works before a job starts.
- Never pass secrets in arguments, environment variables or settings files. Backup setup uses dedicated protected-input methods for passwords.