From a terminal
The panel does not talk to your machine directly. Everything it does goes
through one script — bin/nixarchy-pkg in the plugin directory — and that
script is perfectly usable on its own.
~/.config/omarchy/plugins/nixarchy.pkg/bin/nixarchy-pkg state
Every command prints one JSON object and exits 0. A refusal is a value, not a
crash: {"ok": false, "error": "..."} with exit status 0, because a writer
declining to do something is an answer.
The commands
state |
Everything the panel draws: apps, services, packages, options, drafts |
search <query> --kind pkg\|opt [--limit N] |
The index, ranked |
toggle app\|service <id> |
What SPACE does |
pkg add <attr> [--stable\|--unstable] |
What RETURN and SHIFT+RETURN do |
pkg remove <attr> |
|
opt describe <path> |
An option’s type, default, example and docs |
opt set <path> <value> / opt remove <path> |
|
opt replace <path> <value> |
Change an option already marked in apps.nix |
draft new <url> / draft undraft <name> |
See Drafts |
flake show <ref> / flake list |
Inspect a source or list locked inputs |
flake add [--no-follows] [--no-flake] <name> <ref> |
Declare and lock an input; --no-flake also disables follows |
flake update <name> / flake remove <name> |
Update a locked input, or remove one this tool declared |
recover [--discard] |
Put back what an interrupted write changed, or keep the files as they are. See Troubleshooting |
pending |
What would change on the next apply |
check [--dry-run] |
Evaluate a private copy of the flake with the queued selection |
apply [--pin <part>=<sha256>] |
The rebuild. Streams a log, then one JSON object |
reindex |
Rebuild the search index. About a minute |
Option values
Pass a Nix expression as one shell argument. For example:
nixarchy-pkg opt set services.openssh.ports '[ 80 443 ]'
nixarchy-pkg opt replace services.openssh.ports '[ 22 ]'
opt describe reports widget, item, nullable, multiline,
constraint, and integer min/max bounds. Lists of strings or integers
have a list widget; a null or type can take null. A package type gets a
package widget only if apps.nix takes pkgs.
opt set and opt replace refuse a literal integer outside its bounds.
They also refuse a single string literal, or a list of string literals, that
breaks the declared non-empty, absolute-path, or no-newline-and-colon rule.
Other Nix expressions are left to the usual parse check. A refusal leaves
apps.nix unchanged.
A worked example
Quote a path for the shell when a key contains spaces or punctuation:
nixarchy-pkg opt set 'fileSystems."/mnt/usb drive".options' '[ "nofail" ]'
nixarchy-pkg opt replace 'fileSystems."/mnt/usb drive".options' '[ "nofail" "noauto" ]'
opt set refuses a path already marked in apps.nix; opt replace requires
one. Both refuse invalid paths, including an unfilled <name> or *, and
reject values that would make the file fail Nix’s parse check.
flake add answers with name, url, follows, and message. It does not
return an import field: inspect the source with flake show to see its
modules. flake list returns dir, stale, and inputs. Each input has
name, url, mine, locked, follows, flake, and inspectable; a
marked input missing from the lock sets stale. flake update reports
moved and removed node keys, changed, lockChanged, and the named
input’s from and to modification dates when available.
What is queued, as a list of markers:
nixarchy-pkg pending | jq -r '.changes[].marker'
Every package taken from the other channel:
nixarchy-pkg state | jq -r '.packages[] | select(.channel == "other") | .attr'
Whether this machine follows stable or unstable:
nixarchy-pkg state | jq -r '.channel'
pending
pending snapshots your selection into a private directory under
~/.local/state/nixarchy and compares it against the flake’s copy:
nixarchy-pkg pending | jq
Its object carries:
| Field | Meaning |
|---|---|
ok, neverApplied, base |
Whether the read succeeded, whether $base/nixarchy exists yet, and the flake base path |
writing |
true if a write was in progress or interrupted (pkg-recovery/open existed) during the read |
count |
changes | length — the number of marked-line changes |
changes[] |
{marker, file, line, change, lineNo} where change is on, off, added, removed, or modified (a marked value changed in place), and lineNo is the line number in the live file (or null for off and removed) |
files[] |
{file, label, path, status, unmarked, hunk, conflict, explained} for each changed part or draft. status is new, modified, or dropped; conflict is overwrite, blocks, or null; explained is true when status is modified, unmarked is 0, and at least one changes[] row belongs to this file |
total |
count plus the number of files[] entries with explained: false |
fingerprint |
One 64-digit SHA-256 over every .nix file in the selection snapshot, plus, on a host whose nixarchy handles home.nix, apply’s home decision, names included |
pins |
{apps, services, advanced, flatsnap} — each file’s 64-digit SHA-256, or "" when absent |
sources |
{apps, services, advanced, flatsnap} — each live path in ~/.config/nixarchy, or null when absent |
unpinned |
{drafts: ["packages/<name>.nix", …], flake: true} |
check [--dry-run]
check materialises the flake’s tracked files and your selection into a
private directory under ~/.local/state/nixarchy and evaluates this machine’s
nixosConfigurations.<host>.config.system.build.toplevel.drvPath. With
--dry-run, a passing evaluation also runs nix build --dry-run.
nixarchy-pkg check
nixarchy-pkg check --dry-run
When ok is true, the answer always carries:
| Field | Meaning |
|---|---|
host |
uname -n |
verdict |
evaluates, fails, superseded, or unknown |
fingerprint |
The selection snapshot’s 64-digit SHA-256, built as pending’s is |
pins |
{apps, services, advanced, flatsnap} hashes from the checked snapshot |
unpinned |
{drafts: […], flake: true} |
blocked |
Drafts edited in the flake: [{label, conflict: "blocks"}, …] |
note |
"Checked evaluation only, not a build or a switch. This is evidence, not a guarantee: apply evaluates again for real." (plus " With import-from-derivation on, evaluating may have built some inputs." when allow-import-from-derivation is true) |
Additional fields appear when set:
| Field | When present |
|---|---|
reason |
On verdict: "unknown", why the check declined or timed out |
drvPath |
After a successful evaluation (kept if the verdict then becomes superseded), the evaluated system .drv path |
summary, error, at |
On verdict: "fails", when Nix printed them: the one-line summary, the last 200 lines of rewritten error output, and {file, line} (or null) in ~/.config/nixarchy |
dryRun, dryRunError |
With --dry-run after evaluates: {build, fetch, downloadMiB} (or null), and the error string when the dry run failed |
apply [--pin <part>=<sha256>]
apply accepts repeatable --pin <part>=<sha256> flags, where <part> is
apps, services, advanced, or flatsnap, and <sha256> is 64 lowercase
hex digits (or empty when the file must be absent):
nixarchy-pkg apply --pin apps=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef --pin flatsnap=
Each --pin is forwarded to nixarchy-apply as `–expect-sha256