Skip to content
  1. Docs
  2. enzimOS
  3. Developers

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.

BusSystem bus
Bus name / object / interfaceorg.enzimos.System1 at /org/enzimos/System1
Packageenzimos-backend-prototype (despite the name, this is the backend shipped in current development images); it pins an exact enzimos-native-policy release
ActivationD-Bus activated on first call; nothing starts it at boot
Sourcecrates/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.

MethodPurpose
GetCapabilities()Schema versions, available queries and operations. No authorization needed.
Query(s) → sRead-only status
Operation(s) → sDurable jobs that change the system

Always gate features on GetCapabilities: older images do not provide every query or operation.

Queries

json
{"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.

QueryReturns
systemOS release, kernel, firmware type (uefi/bios), package versions, installed generations, current generation, recovery image readiness
snapshotsUp to 100 newest root and home snapshots: number, UTC date, kind, description, cleanup
backup-pointsUp to 100 newest local backup points: id, time, completeness, size
backup-candidatesPassive list of drives that could become a backup destination, with a selection token when eligible
historyHome history on/off and state, snapshot counts, home retention policy
backupsWhether local/remote backups and the schedule are configured, retention, last cleanup, destination availability, last backup, next run
network-trustThe trusted firewall zone and each NetworkManager connection's zone
memory-policyConfigured and effective memory protection mode, presets, service health
power-policyConfigured 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:

text
{"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}
  1. plan with a selection. The backend returns {"state":"planned","plan_sha256":…}. Show the plan to the user.
  2. submit with that plan_sha256. This is the only step that asks for an administrator password, through the polkit agent.
  3. status — poll until state is completed (read result), cancelled or uncertain.
  4. 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

SchemaOperationSelection
25network-trust-set{"connection":"<NetworkManager UUID>","trusted":bool}
26home-history-set{"enabled":bool}
27backup-schedule-set{"enabled":bool}
28battery-action-set{"action":…,"risk_acknowledged":bool}
30home-retention-set{"hourly","daily","weekly","monthly","yearly","manual"} counts
31backup-retention-set{"automatic":bool,"last","daily","weekly","monthly","yearly"}
32memory-policy-set{"mode":"balanced"|"responsive"|"off","risk_acknowledged":bool}

Backup, update and recovery operations

SchemaOperationSelection
3backup-createnone — creates a new encrypted backup
5update-applynone — stages an update as a new generation; reboot to use it
4recovery-prepare{"birth","generation"}
29own-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 plan with job-plan-changed when no backup destination is configured.
  • Battery action. Actions are auto, suspend, hibernate, power-off and ignore. suspend and ignore require risk_acknowledged: true; the others require false. 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, manual at least 1, and the five timeline counts together 1–1000. New counts apply at the next scheduled cleanup.
  • Backup retention. last is 1–1000; the calendar tiers are 0–1000. Saving retention never starts a backup or prunes immediately.
  • Memory policy. Only off requires 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:

json
{"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:

PresetAvailable memory TERM / KILLFree swap TERM / KILL
Balanced10% / 5%20% / 10%
More responsive15% / 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

CodeMeaning
not-authorizedPolkit or session check failed
service-busyAnother job holds the worker; safe to retry after it ends
job-plan-changedState changed since planning; plan again
job-plan-invalid, request-fields, request-versionMalformed request
operation-unavailableNot supported by this backend
job-not-found, job-owner-mismatch, job-transition-refusedJob lifecycle errors
backup-destination-absentThe backup drive is not attached
backup-destination-not-mountedThe drive is attached but unmounted
backup-destination-busyA backup or other operation is using the drive
backend-result-unknown-do-not-retry-automatically, internal-result-unknown-do-not-retry-automaticallyOutcome 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:

AreaService
Wi-Fi and EthernetNetworkManager
BluetoothBlueZ
BatteryUPower
Power profilespower-profiles-daemon
Firmware updatesfwupd
Time, locale, hostnamesystemd-timedated, localed, hostnamed
Disksudisks2
SoundPipeWire / WirePlumber
User accountsAccountsService

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 uncertain result; 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.