fix(nix): always refresh ssh config snapshot for home-manager

Nix store files have normalized old mtimes, so a -nt check never
notices a newer home-manager generation after the first snapshot.
This commit is contained in:
陈大猫 committed 2026-11-09 01:24:47 +08:00
1 parent b13e545bed
commit 00fdddce05
1 file changed
+4 -4
+4 -4
View File
@@ -41,10 +41,10 @@ let
cache="''${XDG_CACHE_HOME:-$HOME/.cache}/netcatty"
snap="$cache/ssh_config"
mkdir -p "$cache"
if [ ! -e "$snap" ] || [ "$config" -nt "$snap" ]; then
cp -L "$config" "$snap"
chmod 600 "$snap"
fi
# Always refresh: nix store files have frozen old mtimes, so -nt
# never sees a newer home-manager generation after the first copy.
cp -L "$config" "$snap"
chmod 600 "$snap"
exec "$real_ssh" -F "$snap" "$@"
fi
fi