Merge pull request 'chore(lib): drop dead helpers, document schema boundary' (#2) from wave/qa-lib-schema into main
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -39,6 +39,7 @@ Guardrails (apply when adding anything):
|
|||||||
- **Forgejo release pipeline.** `vYY.MM.x` tags matching the upstream NixOS channel; the pipeline pushes the three ISOs and an updated `flake.lock` snapshot.
|
- **Forgejo release pipeline.** `vYY.MM.x` tags matching the upstream NixOS channel; the pipeline pushes the three ISOs and an updated `flake.lock` snapshot.
|
||||||
- **Optional `nomarchy-installer-vm`** rebuilt as a real flake app (not a one-off shell script) so users can install Nomarchy into a libvirt VM declaratively.
|
- **Optional `nomarchy-installer-vm`** rebuilt as a real flake app (not a one-off shell script) so users can install Nomarchy into a libvirt VM declaratively.
|
||||||
- **Surface support module** via the relevant `nixos-hardware` profile + Surface kernel patches behind a `nomarchy.hardware.isSurface` toggle.
|
- **Surface support module** via the relevant `nixos-hardware` profile + Surface kernel patches behind a `nomarchy.hardware.isSurface` toggle.
|
||||||
|
- **Consolidate palette imports in `flake.nix` via `nomarchyLib`.** `flake.nix:79-80` re-imports `./themes/palettes` and recomputes `themeNames` even though `lib/default.nix` already exports both. Two computations, same result today — drift risk tomorrow. Import `nomarchyLib = import ./lib { inherit lib; }` once and use `nomarchyLib.{palettes,themeNames}` to make `lib/default.nix` the single source of truth for the theme list.
|
||||||
|
|
||||||
## 3. Pillar: Script & menu audit
|
## 3. Pillar: Script & menu audit
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ let
|
|||||||
in {
|
in {
|
||||||
inherit
|
inherit
|
||||||
palettes
|
palettes
|
||||||
readState
|
|
||||||
readHomeState
|
readHomeState
|
||||||
readSystemState
|
readSystemState
|
||||||
resolveWallpaper
|
resolveWallpaper
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# Nomarchy State Schema
|
# Nomarchy State Schema
|
||||||
# Defines the complete state shape with defaults for both home and system state
|
#
|
||||||
|
# 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 }:
|
{ lib }:
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -54,14 +62,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Get a value from state with fallback to default
|
|
||||||
getWithDefault = state: path: default:
|
|
||||||
let
|
|
||||||
pathList = lib.splitString "." path;
|
|
||||||
getValue = obj: remaining:
|
|
||||||
if remaining == [] then obj
|
|
||||||
else if builtins.isAttrs obj && builtins.hasAttr (builtins.head remaining) obj
|
|
||||||
then getValue obj.${builtins.head remaining} (builtins.tail remaining)
|
|
||||||
else default;
|
|
||||||
in getValue state pathList;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user