fix(git): back up a stray ~/.gitconfig after writeBoundary

Move it aside with HM's `run mv` (dry-run aware) instead of an
unconditional rm before checkLinkTargets.

Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
Ryan Yin authored and ryan4yin | 二花 committed 2026-11-01 11:55:14 -06:00
1 parent ce49b03014
commit 4ecb7c475e
1 file changed
+4 -3
+4 -3
View File
@@ -1,5 +1,4 @@
{
config,
lib,
pkgs,
myvars,
@@ -10,8 +9,10 @@
# to make git use this config file, `~/.gitconfig` should not exist!
#
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
rm -f ${config.home.homeDirectory}/.gitconfig
home.activation.backupExistingGitconfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if [[ -e ~/.gitconfig ]]; then
run mv $VERBOSE_ARG ~/.gitconfig ~/.gitconfig.bak
fi
'';
# GitHub CLI tool