From 9e37e119159cb4a9c38f327f2142998c018a82f4 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sun, 12 Jul 2026 12:52:05 +0100 Subject: [PATCH] feat(lifecycle): auto-commit sweep of the machine flake before pull/rebuild/home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With settings.autoCommit on, only menu/theme mutations were committed (theme-sync pathspec-limits to theme-state.json by design), so hand edits to system.nix/home.nix and lock bumps stayed forever-dirty. New internal nomarchy-autocommit (nomarchy-lifecycle): live-reads the same flag, commits everything dirty as "nomarchy: auto-commit before " with the swept file list in the body, fallback identity, never fatal (|| true at call sites). Called at the top of all three lifecycle commands; before the ff-only pull it also un-dirties the tree. Exposed via passthru.autocommit + package export; guarded by checks.lifecycle-autocommit (sandbox repos: sweep, no-op on clean/off/non-repo). Sync sweep: README, RECOVERY, ROADMAP, rofi toggle, control-center prompt, theme-sync docstring, JOURNAL. Verified: V1+ — flake check --no-build green; the new check builds; end-to-end run of the built nomarchy-rebuild (stubbed sudo/rebuild) against a copy of a real dirty ~/.nomarchy: 4 files → one commit, clean tree. No VM boot — no session-visible surface. Co-Authored-By: Claude Fable 5 --- README.md | 5 +- agent/JOURNAL.md | 22 ++++++++ docs/RECOVERY.md | 6 ++- docs/ROADMAP.md | 12 +++++ flake.nix | 50 +++++++++++++++++++ modules/home/rofi.nix | 6 ++- .../nomarchy-control-center.sh | 2 +- pkgs/nomarchy-lifecycle/default.nix | 45 +++++++++++++++++ .../nomarchy-theme-sync.py | 5 +- 9 files changed, 146 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3507ee2..815caec 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,10 @@ nomarchy-what-changed # plain-language last rebuild (system + desktop; --summar `~/.nomarchy` is **your machine flake** (`system.nix` / `home.nix`). Newer Nomarchy code arrives when `flake.lock` updates the `nomarchy` input (`nomarchy-pull`), not by `git pull` of that directory (many installs have -no remote there — only local commits from auto-commit). +no remote there — only local commits from auto-commit). With auto-commit +on (menu: **System › Auto-commit**), all three commands above also sweep +any pending hand edits into a commit before they switch, so +`git -C ~/.nomarchy log` mirrors your generations. | When | Run | |---|---| diff --git a/agent/JOURNAL.md b/agent/JOURNAL.md index 66840df..22f2be1 100644 --- a/agent/JOURNAL.md +++ b/agent/JOURNAL.md @@ -19,6 +19,28 @@ Template: --- +## 2026-07-12 — auto-commit sweep before pull/rebuild/home (interactive) +- **Task:** Bernardo's request (no BACKLOG item): with autoCommit on, + hand edits to `~/.nomarchy` (his had 4) stayed forever-dirty — + theme-sync's commit is pathspec-limited to theme-state.json by design. +- **Did:** New internal `nomarchy-autocommit` in nomarchy-lifecycle: + live-reads `settings.autoCommit`, commits *everything* dirty with + message `nomarchy: auto-commit before