From 4ecb7c475e09779055d841b645a8ce6ad9ec9535 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Mon, 2 Nov 2026 00:59:26 +0800 Subject: [PATCH] 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) --- home/base/core/git.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/home/base/core/git.nix b/home/base/core/git.nix index 73896236..a0062d59 100644 --- a/home/base/core/git.nix +++ b/home/base/core/git.nix @@ -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