fix: keep herdr runtime state out of the dotfiles working tree #3

Merged
hermes merged 8 commits from fm/fm-clone-runtime-dirt-dotfiles into main 2026-10-06 10:25:47 -04:00
Showing only changes of commit bafec48ceb - Show all commits
+14 -6
View File
@@ -100,18 +100,26 @@ in
# the real directory. A real directory (the post-migration state) is left # the real directory. A real directory (the post-migration state) is left
# untouched, so this is idempotent. The old whole-directory symlink also left # untouched, so this is idempotent. The old whole-directory symlink also left
# herdr runtime state (sockets, logs, session.json, session-snapshots/, ...) in # herdr runtime state (sockets, logs, session.json, session-snapshots/, ...) in
# this repo; that state now resolves to the real directory, so clear every # this repo; that state now resolves to the real directory, so remove the known
# leftover except the tracked config.toml. Unlinking a live socket or log only # runtime artifacts by name. config.toml and any other repo content in that
# drops the path - the running herdr server keeps its own file handles. # 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" ] '' home.activation.herdrConfigDir = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
set -euo pipefail set -euo pipefail
if [ -L "$HOME/.config/herdr" ]; then if [ -L "$HOME/.config/herdr" ]; then
rm "$HOME/.config/herdr" run ${pkgs.coreutils}/bin/rm "$HOME/.config/herdr"
fi fi
repoHerdr="${dotfiles}/home/.config/herdr" repoHerdr="${dotfiles}/home/.config/herdr"
if [ -d "$repoHerdr" ]; then if [ -d "$repoHerdr" ]; then
${pkgs.findutils}/bin/find "$repoHerdr" -mindepth 1 -maxdepth 1 \ run ${pkgs.coreutils}/bin/rm -rf \
! -name config.toml -exec ${pkgs.coreutils}/bin/rm -rf {} + "$repoHerdr/herdr.sock" \
"$repoHerdr/herdr-client.sock" \
"$repoHerdr/herdr.sock.agent" \
"$repoHerdr/herdr-server.log" \
"$repoHerdr/.plugins.lock" \
"$repoHerdr/session.json" \
"$repoHerdr/release-notes.json" \
"$repoHerdr/session-snapshots"
fi fi
''; '';