Skip to main content

Crate planarian_backend_linux

Crate planarian_backend_linux 

Source
Expand description

The real backends for Phase A on NixOS 26.05 (§5), behind the schema’s backend traits.

The process-spawning modules talk to the system through its own command- line tools (systemctl, loginctl, nix, systemd-run, nmcli). Their output formats are stable, and that keeps the dependency set small (see docs/deviations.md: §17 names zbus). Every mutating call first checks its OpId’s epoch against the transaction’s fence file and refuses a stale one before touching anything (§12 fencing).

Modules§

cmd
Running a command with a timeout and bounded output.
hold
§12d Network security fails closed: the hold, as lane-nix’s planarian-hold@<unit>.service (nix/posture.nix) builds it. This module only starts and stops that unit, reads which holds are in place, and writes the release marker the hold script honours:
logind
SessionBackend over logind (loginctl) and the kernel’s power-supply class.
nixos
GenerationBackend over Nix and NixOS’s switch-to-configuration.
probe
ProbeBackend: TCP, HTTP, sandboxed exec and free-space probes (§10 probe contract). A probe’s timeout is a deadline for the whole probe: name resolution, connection, writing and every read count against the one budget (R06). A batch runs on a bounded pool and returns by its deadline; a probe still running then is recorded Abandoned (Unknown, never Failed) and abandoned; Timeout is a probe past its own deadline. Output is data: it is truncated and logged, never interpreted as instructions.
process
ProcessBackend and Clock on the real system.
runtime
RuntimeOptionBackend (§12a). Phase A applies Wi-Fi selection live through NetworkManager. Font scale and keyboard layout have no live mechanism here; they take effect through their write-back (the catalog change), and set says so.
sysfs
InventoryBackend over sysfs: which configured devices are present, which driver each is bound to, and bind/unbind through the driver interface.
systemd
UnitBackend over systemd (§8 systemd mapping).

Structs§

Paths
Filesystem locations. Defaults match the NixOS module.
Real
Everything, for the daemon and the watchdog.

Functions§

admitted
§12 fencing: a mutating call is refused unless its epoch is the one in the transaction’s fence file.