Skip to content

Commit 211812e

Browse files
api.md: regenerate from nasty@33281ba
1 parent fc904bd commit 211812e

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

api.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,26 @@ Return current version and latest available version.
290290
|-------|------|:--------:|-------------|
291291
| `channel` | `ReleaseChannel` | yes | Active release channel. |
292292
| `current_version` | string | yes | Currently installed version (short commit SHA or `dev`). |
293+
| `error` | string | no | Human-readable explanation when the latest-version lookup failed
294+
(GitHub unreachable, rate-limited, refused token, …). Populated
295+
by `check()`; `version()` leaves it `None`. Surfaced in the UI
296+
as an amber banner so operators don't see a silent dash when
297+
GitHub is misbehaving — previously the failure mode was
298+
indistinguishable from "no check has ever run". |
299+
| `inputs` | `VersionInputInfo`[] | no | Snapshot of each tracked flake input (`nasty`, `nixpkgs`,
300+
`bcachefs-tools`) — name, URL, locked rev. Embedded here so the
301+
Version page can render all three pinned components in the
302+
summary card without making a second RPC. None when the
303+
engine can't read the local flake (parse error, fresh install
304+
pre-bootstrap, etc); the UI falls back to the nasty rev alone
305+
in that case. |
306+
| `last_attempt` | string | no | Result of the last upgrade-unit invocation: `"success"`, `"failed"`,
307+
or `None` if no upgrade has ever been kicked off (or it's still
308+
running). When `"failed"`, the engine forces `update_available =
309+
Some(true)` regardless of the tag comparison so the WebUI keeps
310+
offering Upgrade — a failed rebuild often leaves `flake.lock`
311+
pointing at the target tag, which would otherwise make the check
312+
look like a no-op. |
293313
| `latest_version` | string | no | Latest upstream version, if the check has been performed. |
294314
| `update_available` | boolean | no | Whether a newer version is available. None if the check has not been run yet. |
295315

@@ -306,6 +326,26 @@ Check for available updates against the upstream repository.
306326
|-------|------|:--------:|-------------|
307327
| `channel` | `ReleaseChannel` | yes | Active release channel. |
308328
| `current_version` | string | yes | Currently installed version (short commit SHA or `dev`). |
329+
| `error` | string | no | Human-readable explanation when the latest-version lookup failed
330+
(GitHub unreachable, rate-limited, refused token, …). Populated
331+
by `check()`; `version()` leaves it `None`. Surfaced in the UI
332+
as an amber banner so operators don't see a silent dash when
333+
GitHub is misbehaving — previously the failure mode was
334+
indistinguishable from "no check has ever run". |
335+
| `inputs` | `VersionInputInfo`[] | no | Snapshot of each tracked flake input (`nasty`, `nixpkgs`,
336+
`bcachefs-tools`) — name, URL, locked rev. Embedded here so the
337+
Version page can render all three pinned components in the
338+
summary card without making a second RPC. None when the
339+
engine can't read the local flake (parse error, fresh install
340+
pre-bootstrap, etc); the UI falls back to the nasty rev alone
341+
in that case. |
342+
| `last_attempt` | string | no | Result of the last upgrade-unit invocation: `"success"`, `"failed"`,
343+
or `None` if no upgrade has ever been kicked off (or it's still
344+
running). When `"failed"`, the engine forces `update_available =
345+
Some(true)` regardless of the tag comparison so the WebUI keeps
346+
offering Upgrade — a failed rebuild often leaves `flake.lock`
347+
pointing at the target tag, which would otherwise make the check
348+
look like a no-op. |
309349
| `latest_version` | string | no | Latest upstream version, if the check has been performed. |
310350
| `update_available` | boolean | no | Whether a newer version is available. None if the check has not been run yet. |
311351

@@ -340,6 +380,60 @@ Return the current update operation status and log.
340380
| `webui_changed` | boolean | yes | True when the webui store path changed during this update (browser reload needed) |
341381

342382

383+
### `system.update.build_dir.get`
384+
385+
Return the configured Nix build-dir spillover path (if any) plus the live list of mounted bcachefs pools eligible to host the sandbox. Useful on small-rootfs installs where the default `/tmp` (tmpfs) doesn't have room for kernel-module / Rust compile sandboxes.
386+
387+
**Role:** `any`
388+
389+
**Returns:**
390+
391+
| Field | Type | Required | Description |
392+
|-------|------|:--------:|-------------|
393+
| `available_pools` | string[] | yes | Mounted bcachefs pool roots under `/fs/` discovered live from
394+
`/proc/mounts`. Used by the WebUI to populate the dropdown of
395+
viable spillover targets. Empty on single-disk (mode-1)
396+
installs that don't have a separate data pool — the feature
397+
can't help those boxes and the UI hides the option. |
398+
| `path` | string | no | Persisted spillover path (`None` = unset, builds use the
399+
default `/tmp` → tmpfs → root path). Returned verbatim from
400+
the on-disk setting, **not** the auto-resolved
401+
`<pool>/.nasty-nix-build` derivation — the WebUI dropdown
402+
stores pool roots, the engine resolves at script-render time. |
403+
| `resolved` | string | no | Resolved sandbox path the engine would actually pass to
404+
`nixos-rebuild` (i.e. `<pool>/.nasty-nix-build`). Surfaced so
405+
the WebUI can show operators where the spillover will land
406+
without re-implementing the derivation rule. |
407+
408+
409+
### `system.update.build_dir.set`
410+
411+
Set or clear the Nix build-dir spillover path. Pass `{"path": "/fs/<pool>"}` to enable (must match one of the mounted bcachefs pools reported by `build_dir.get`) or `{"path": null}` to disable. When set, the engine runs upgrade scripts with `NIX_REMOTE=local` and `--option build-dir <pool>/.nasty-nix-build` so the sandbox spills onto bcachefs instead of tmpfs/root.
412+
413+
**Role:** `admin`
414+
415+
**Params:** `{"path": string | null}`
416+
417+
**Returns:**
418+
419+
| Field | Type | Required | Description |
420+
|-------|------|:--------:|-------------|
421+
| `available_pools` | string[] | yes | Mounted bcachefs pool roots under `/fs/` discovered live from
422+
`/proc/mounts`. Used by the WebUI to populate the dropdown of
423+
viable spillover targets. Empty on single-disk (mode-1)
424+
installs that don't have a separate data pool — the feature
425+
can't help those boxes and the UI hides the option. |
426+
| `path` | string | no | Persisted spillover path (`None` = unset, builds use the
427+
default `/tmp` → tmpfs → root path). Returned verbatim from
428+
the on-disk setting, **not** the auto-resolved
429+
`<pool>/.nasty-nix-build` derivation — the WebUI dropdown
430+
stores pool roots, the engine resolves at script-render time. |
431+
| `resolved` | string | no | Resolved sandbox path the engine would actually pass to
432+
`nixos-rebuild` (i.e. `<pool>/.nasty-nix-build`). Surfaced so
433+
the WebUI can show operators where the spillover will land
434+
without re-implementing the derivation rule. |
435+
436+
343437
### `system.version.get`
344438

345439
Return exact input URLs from `/etc/nixos/flake.nix` and locked revs from `/etc/nixos/flake.lock` for the Version page.

0 commit comments

Comments
 (0)