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 # home-manager links ~/.config/herdr/config.toml by following the existing
# ~/.config/herdr symlink, which would move this repo's own tracked config.toml # ~/.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 # to config.toml.backup and leave a symlink inside the tree. Drop the stale
# symlink before home-manager checks link targets; linkGeneration then creates # symlink in the write phase, after writeBoundary and before linkGeneration:
# the real directory. A real directory (the post-migration state) is left # checkLinkTargets already skips this target because the file is force = true,
# untouched, so this is idempotent. The old whole-directory symlink also left # and linkGeneration then creates the real directory. A real directory (the
# herdr runtime state (sockets, logs, session.json, session-snapshots/, ...) in # post-migration state) is left untouched, so this is idempotent. The old
# this repo; that state now resolves to the real directory, so remove the known # whole-directory symlink also left herdr runtime state (sockets, logs,
# runtime artifacts by name. config.toml and any other repo content in that # session.json, session-snapshots/, ...) in this repo; that state now resolves
# directory are never touched. Removing a live socket or log only drops the # to the real directory, so remove the known runtime artifacts by name.
# path - the running herdr server keeps its own file handles. # config.toml and any other repo content in that directory are never touched.
home.activation.herdrConfigDir = lib.hm.dag.entryBefore [ "checkLinkTargets" ] '' # 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 set -euo pipefail
if [ -L "$HOME/.config/herdr" ]; then if [ -L "$HOME/.config/herdr" ]; then
run ${pkgs.coreutils}/bin/rm "$HOME/.config/herdr" run ${pkgs.coreutils}/bin/rm "$HOME/.config/herdr"