diff --git a/home.nix b/home.nix index cd8b3d1..a5ed090 100644 --- a/home.nix +++ b/home.nix @@ -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"