pi: merge declared settings into a persisted settings.json #1498

Merged
JakeHillion merged 1 commits from jj/qqkoruyukukv into main 2026-12-06 01:17:35 +00:00
1 Commits
Author SHA1 Message Date
JakeHillion 635b992acd pi: merge declared settings into a persisted settings.json
commit-validation / validate-single-commit (pull_request) Successful in 3s
buildbot/nix-eval Build done. (30 warnings)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Pi saves fields of its own into ~/.pi/agent/settings.json, such as the
deviceId it sends OpenAI when signing in with ChatGPT and defaults saved
from the model picker. The file was a home-manager link into the Nix
store, so every save failed silently and Pi made a new deviceId for every
login. ogygia-nix-fixer copied its settings in only when the file was
missing, so changes to them never reached an existing install.

Added pi-merge-settings, which replaces each top-level field the Nix
config declares, keeps every other field, and logs the path of each value
the replacement drops without the value. The home module persists
settings.json and runs it on every home-manager activation, so the log
lands in the journal under home-manager-jake. The fixer runs it in
preStart in place of its one-time copy. An AGENTS.md tells Pi where its
configuration comes from, so it proposes changes to this repository
rather than editing files a deploy overwrites.

Test plan:
- CI
- Built maverick's and iceman's toplevels
- Ran pi-merge-settings on a missing file, an unchanged file, a file with
  changed declared fields plus a deviceId, and a declared object replaced
  by a string: it logged only the changed paths and kept deviceId
2026-12-06 01:09:23 +00:00