feat(autotheme): #79 slice 2 — systemd timer runs auto
All checks were successful
Check / eval (push) Successful in 3m53s
All checks were successful
Check / eval (push) Successful in 3m53s
modules/home/autotheme.nix installs a user service + timer (nomarchy-auto-theme) that periodically runs `nomarchy-theme-sync auto`, so the day/night theme is applied on the current schedule through the same one engine. Install gates on settings.autoTheme.enable (read from state, the way updates.nix gates on its enable), so a machine not using the feature carries no timer. Timer: OnStartupSec=1min (settle after login) + OnCalendar=*:0/15 + Persistent (catch a transition missed while off). Periodic rather than exact sunrise/sunset timers — robust to suspend/DST, and `auto` is idempotent (no rebuild unless the theme must change) so ticks are cheap. Verification: V1 — real-config eval (state temporarily enabled, then restored) confirms the units land when enabled (OnCalendar *:0/15, ExecStart `... nomarchy-theme-sync auto`) and are absent when disabled; systemd-analyze validates the schedule. V0 flake check green. The live timer -> home-manager switch on a real Nomarchy session is pending a Nomarchy machine (same blocker as #76). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,15 @@ Auto light/dark theme switch through the **existing** engine (a timer runs
|
||||
`--which` prints the decision, `--force`/`--no-switch` too. `cmd_apply`
|
||||
core factored into `apply_named` (behavior unchanged). V1 + functional
|
||||
tests (day/night/disabled/missing-slugs, apply writes state, idempotent).
|
||||
2. **Timer/hook** — systemd user timers at sunrise+sunset running
|
||||
`nomarchy-theme-sync auto`, gated on `settings.autoTheme.enable`; apply
|
||||
the correct theme at session start too. V2 (runNixOSTest).
|
||||
2. ~~**Timer/hook**~~ ✓ shipped 2026-07-10 — `modules/home/autotheme.nix`:
|
||||
`systemd.user.{service,timer}.nomarchy-auto-theme`, install gated on
|
||||
`settings.autoTheme.enable` (read from state), `OnStartupSec=1min` +
|
||||
`OnCalendar=*:0/15` + `Persistent`. Chose periodic (not exact
|
||||
sunrise/sunset timers) — robust to suspend/DST, and `auto` is idempotent
|
||||
so ticks are cheap. V1: real-config eval shows units land when enabled
|
||||
(OnCalendar `*:0/15`, ExecStart `… auto`), absent when disabled;
|
||||
systemd-analyze validates the schedule. **Real-session check pending**
|
||||
(live timer→`home-manager switch`) — needs a Nomarchy machine, like #76.
|
||||
3. **Menu** — Look & Feel › Auto theme: enable/disable, pick day/night
|
||||
themes, set times. Writes state.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user