Files
Nomarchy/lib/state-schema.nix
Bernardo Magri 27d1506b54 chore(lib): drop dead helpers, document schema boundary
Two unused helpers and a missing comment in the lib/ surface, found
during the Pillar 8 sweep.

- `readState` in `lib/default.nix` was exported but has no external
  callers — only `readHomeState` and `readSystemState` use it
  internally. Removed from the export list; the function stays in the
  let-block (still wraps the two public readers).

- `getWithDefault` in `lib/state-schema.nix` was a complete dead
  function: declared as a path-walking fallback helper but never called
  anywhere in the tree. core/{system,home}/state.nix use inline
  `togglesState.<key> or schema.<scope>.<key>` instead. Removed.

- Added a header comment to `lib/state-schema.nix` explaining the
  schema's boundary — it lists every state.json field consumed by a
  Nix option, but state.json may also hold runtime-only fields
  (`welcome_done` from `nomarchy-welcome`) that are intentionally
  off-schema because no Nix option reads them. Future readers will
  otherwise think welcome_done is an orphan.

Logged a Later-column roadmap row for consolidating `flake.nix`'s
palette/themeNames re-imports with `nomarchyLib` so the theme list has
one source of truth instead of two.
2026-05-19 18:28:54 +01:00

66 lines
1.5 KiB
Nix

# Nomarchy State Schema
#
# Defines the default values for every state.json field that's consumed by a
# Nix option. Read by core/{system,home}/options.nix (for `default = …`) and
# by core/{system,home}/state.nix (for `or` fallbacks).
#
# state.json may also hold runtime-only fields that aren't declared here —
# notably `welcome_done`, managed by `nomarchy-welcome`. Those are intentionally
# off-schema because no Nix option reads them; the schema is the "consumed by
# Nix" surface, not the full state.json shape.
{ lib }:
{
# Home state defaults (user preferences)
home = {
# Theme and appearance
theme = "summer-night";
wallpaper = "";
font = "JetBrainsMono Nerd Font";
panelPosition = "top";
nightlightTemperature = 4000;
# Feature toggles
suspend = true;
screensaver = true;
idle = true;
nightlight = false;
waybar = true;
skipVsCodeTheme = false;
# Hyprland window manager settings
hyprland = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
};
};
# System state defaults (system-level configuration)
system = {
# Theme (can differ from home for system-level theming)
theme = "summer-night";
# Timezone
timezone = "UTC";
# DNS configuration
dns = "DHCP"; # Options: "DHCP", "Cloudflare", "Google", "Custom"
customDns = [];
# Wi-Fi settings
wifi = {
powersave = true;
};
# Optional features
features = {
fingerprint = false;
fido2 = false;
hybridGPU = false;
makima = false;
};
};
}