refactor(#107): theme-state.json → state.json, theme-sync → state-sync
Some checks failed
Check / eval (push) Has been cancelled

The machine flake's git-tracked settings file is system state, not
"theme" only — rename it to state.json. CLI becomes nomarchy-state-sync
with a nomarchy-theme-sync symlink for scripts and muscle memory.

Eval (mkFlake, doctor, lifecycle) still accepts theme-state.json; the
next write migrates to state.json and removes the legacy file.
Documented in MIGRATION.md; drop the CLI alias after release notes.
This commit is contained in:
2026-07-15 11:26:59 +01:00
parent 013403deb4
commit d8e1a13d50
62 changed files with 463 additions and 369 deletions

View File

@@ -15,12 +15,12 @@ let
flake="''${NOMARCHY_PATH:-$HOME/.nomarchy}"
'';
# Opt-in sweep (settings.autoCommit — the same flag theme-sync honours):
# Opt-in sweep (settings.autoCommit — the same flag state-sync honours):
# commit EVERYTHING dirty in the machine flake before a pull/rebuild/
# home switch, so hand edits to system.nix/home.nix and lock bumps land
# in history at the moment they become live — `git log` mirrors the
# generation list. Complements nomarchy-theme-sync's auto_commit, which
# is pathspec-limited to theme-state.json on menu writes precisely so
# generation list. Complements nomarchy-state-sync's auto_commit, which
# is pathspec-limited to state.json on menu writes precisely so
# half-finished hand edits never ride a settings-named commit; here the
# sweep is the point, and the commit body lists what was swept. Never
# fatal — callers `|| true` so a git hiccup can't block a rebuild. Not
@@ -31,8 +31,12 @@ let
label="''${1:-rebuild}"
[ -d "$flake/.git" ] || exit 0
command -v git >/dev/null 2>&1 || exit 0
# #107: prefer state.json; still honour a legacy theme-state.json
# until the next menu write migrates the checkout.
state="$flake/state.json"
[ -r "$state" ] || state="$flake/theme-state.json"
flag=$(${jq}/bin/jq -r '.settings.autoCommit // false' \
"$flake/theme-state.json" 2>/dev/null || true)
"$state" 2>/dev/null || true)
[ "$flag" = "true" ] || exit 0
dirty=$(git -C "$flake" status --porcelain || true)
[ -n "$dirty" ] || exit 0