no-mistakes(review): home: move herdr migration after writeBoundary before linkGeneration

This commit is contained in:
Lap Tran committed 2026-10-05 22:24:32 -04:00
1 parent bafec48ceb
commit d5fc8758a5
1 file changed
+11 -9
+11 -9
View File
@@ -96,15 +96,17 @@ in
# home-manager links ~/.config/herdr/config.toml by following the existing
# ~/.config/herdr symlink, which would move this repo's own tracked config.toml
# to config.toml.backup and leave a symlink inside the tree. Drop the stale
# symlink before home-manager checks link targets; linkGeneration then creates
# the real directory. A real directory (the post-migration state) is left
# untouched, so this is idempotent. The old whole-directory symlink also left
# herdr runtime state (sockets, logs, session.json, session-snapshots/, ...) in
# this repo; that state now resolves to the real directory, so remove the known
# runtime artifacts by name. config.toml and any other repo content in that
# directory are never touched. Removing a live socket or log only drops the
# path - the running herdr server keeps its own file handles.
home.activation.herdrConfigDir = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
# symlink in the write phase, after writeBoundary and before linkGeneration:
# checkLinkTargets already skips this target because the file is force = true,
# and linkGeneration then creates the real directory. A real directory (the
# post-migration state) is left untouched, so this is idempotent. The old
# whole-directory symlink also left herdr runtime state (sockets, logs,
# session.json, session-snapshots/, ...) in this repo; that state now resolves
# to the real directory, so remove the known runtime artifacts by name.
# config.toml and any other repo content in that directory are never touched.
# Removing a live socket or log only drops the path - the running herdr server
# keeps its own file handles.
home.activation.herdrConfigDir = lib.hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
set -euo pipefail
if [ -L "$HOME/.config/herdr" ]; then
run ${pkgs.coreutils}/bin/rm "$HOME/.config/herdr"