refactor(#107): theme-state.json → state.json, theme-sync → state-sync
Some checks failed
Check / eval (push) Has been cancelled
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:
@@ -17,7 +17,7 @@
|
||||
, btrfs-progs # inspect-internal map-swapfile (hibernation offset)
|
||||
, xkeyboard_config # human-readable installed layout/variant catalog
|
||||
# Baked metadata — what this installer installs and where it came from.
|
||||
, templateDir # templates/downstream (home.nix, theme-state.json)
|
||||
, templateDir # templates/downstream (home.nix, state.json)
|
||||
, nomarchyLock # the distro's flake.lock (for offline lock composition)
|
||||
, hardwareModuleNames # newline-separated nixos-hardware module names
|
||||
, nixpkgsPath # pinned nixpkgs source (NIX_PATH for disko's eval)
|
||||
@@ -54,7 +54,7 @@ stdenvNoCC.mkDerivation {
|
||||
mkdir -p "$share/template"
|
||||
# Full downstream template is the SoT; install script copies + patches.
|
||||
cp ${templateDir}/flake.nix ${templateDir}/system.nix \
|
||||
${templateDir}/home.nix ${templateDir}/theme-state.json \
|
||||
${templateDir}/home.nix ${templateDir}/state.json \
|
||||
"$share/template/"
|
||||
install -Dm644 patch-template.py "$share/patch-template.py"
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ rm -rf /mnt/etc/nixos
|
||||
cp "$SHARE/template/flake.nix" \
|
||||
"$SHARE/template/system.nix" \
|
||||
"$SHARE/template/home.nix" \
|
||||
"$SHARE/template/theme-state.json" \
|
||||
"$SHARE/template/state.json" \
|
||||
"$FLAKE_DIR/"
|
||||
|
||||
# Detected hardware → flags for the patcher (safe defaults active).
|
||||
@@ -679,7 +679,7 @@ if (( compose_ok != 0 )); then
|
||||
(cd "$FLAKE_DIR" && nix --extra-experimental-features "nix-command flakes" flake lock)
|
||||
fi
|
||||
|
||||
# A flake worktree must be git-tracked (theme-state.json especially).
|
||||
# A flake worktree must be git-tracked (state.json especially).
|
||||
(
|
||||
cd "$FLAKE_DIR"
|
||||
git init -q
|
||||
@@ -702,7 +702,7 @@ success "Configuration written to ~$USERNAME/.nomarchy"
|
||||
section "Installing (this takes a while)"
|
||||
|
||||
# Seed the target store with the flake source + all inputs so the first
|
||||
# `nomarchy-theme-sync apply` (and the HM pre-activation below) work
|
||||
# `nomarchy-state-sync apply` (and the HM pre-activation below) work
|
||||
# before the machine has ever seen a network. Two steps because
|
||||
# `flake archive --to` enforces signatures and locally-evaluated source
|
||||
# paths have none; plain `nix copy` accepts --no-check-sigs.
|
||||
|
||||
@@ -116,7 +116,7 @@ def build_installer_region(v: dict) -> str:
|
||||
]
|
||||
|
||||
# Auto-login is deliberately NOT emitted here — it is seeded into
|
||||
# theme-state.json instead (patch_state). A line in system.nix outranks
|
||||
# state.json instead (patch_state). A line in system.nix outranks
|
||||
# the state default, which would make the System › Auto-login toggle
|
||||
# write JSON that nothing reads.
|
||||
|
||||
@@ -260,7 +260,7 @@ def patch_system(text: str, v: dict) -> str:
|
||||
|
||||
|
||||
def patch_state(text: str, v: dict) -> str:
|
||||
"""Seed menu-owned settings into theme-state.json.
|
||||
"""Seed menu-owned settings into state.json.
|
||||
|
||||
These live in the state rather than system.nix precisely so the menu can
|
||||
change them later: a baked Nix assignment would outrank the state default
|
||||
@@ -286,7 +286,7 @@ def main() -> None:
|
||||
"flake.nix": patch_flake,
|
||||
"home.nix": patch_home,
|
||||
"system.nix": patch_system,
|
||||
"theme-state.json": patch_state,
|
||||
"state.json": patch_state,
|
||||
}
|
||||
for name, fn in mapping.items():
|
||||
path = flake_dir / name
|
||||
|
||||
Reference in New Issue
Block a user