docker/symbolics: restore persistent home after Home Manager activation #87

Open
nsaspy wants to merge 2 commits from fix/persistent-home-restore into main
Owner

Closes #71\n\n## What\n\n- New restore_home stage in docker/symbolics/initialize.sh, gated by A0_PERSISTENT_HOME_DIR (default /a0/usr/home), running after Home Manager activation and before system-job prep.\n- Symlinks persisted home entries into /tmp/phdst (default /root) so SSH keys, git credentials, and other /root state survive container recreation.\n- Safety semantics: non-empty image-/Home-Manager-owned targets always win; empty real directories (bare .ssh) are replaced; fully idempotent.\n\n## Verification\n\nFive scenarios exercised against the extracted function: empty persistent home keeps fresh /root, populated home links in (.ssh, .gitconfig), non-empty HM-owned dir wins, empty dir gets replaced, idempotent rerun.\n\nAlso restores the lost executable bit carried by the earlier working-tree diff.

Closes #71\n\n## What\n\n- New `restore_home` stage in `docker/symbolics/initialize.sh`, gated by `A0_PERSISTENT_HOME_DIR` (default `/a0/usr/home`), running after Home Manager activation and before system-job prep.\n- Symlinks persisted home entries into `/tmp/phdst` (default `/root`) so SSH keys, git credentials, and other `/root` state survive container recreation.\n- Safety semantics: non-empty image-/Home-Manager-owned targets always win; empty real directories (bare `.ssh`) are replaced; fully idempotent.\n\n## Verification\n\nFive scenarios exercised against the extracted function: empty persistent home keeps fresh `/root`, populated home links in (`.ssh`, `.gitconfig`), non-empty HM-owned dir wins, empty dir gets replaced, idempotent rerun.\n\nAlso restores the lost executable bit carried by the earlier working-tree diff.
Root-owned state in /root (SSH keys, git credentials) was lost on
container recreation because only /nix and /a0/usr persist. Add an
A0_PERSISTENT_HOME_DIR (default /a0/usr/home) stage after Home Manager
activation that symlinks persisted home entries into $A0_HOME_DIR
(default /root), never clobbering non-empty image/HM-owned targets.
Verified against five scenarios: empty src, populated src, HM-owned
dir wins, empty dir replaced, idempotent rerun.

Fixes #71
This pull request has changes conflicting with the target branch.
  • docker/symbolics/initialize.sh
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/persistent-home-restore:fix/persistent-home-restore
git switch fix/persistent-home-restore

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/persistent-home-restore
git switch fix/persistent-home-restore
git rebase main
git switch main
git merge --ff-only fix/persistent-home-restore
git switch fix/persistent-home-restore
git rebase main
git switch main
git merge --no-ff fix/persistent-home-restore
git switch main
git merge --squash fix/persistent-home-restore
git switch main
git merge --ff-only fix/persistent-home-restore
git switch main
git merge fix/persistent-home-restore
git push origin main
Sign in to join this conversation.
No description provided.