diff --git a/modules/programs/gh.nix b/modules/programs/gh.nix index bdd939dee..192762a28 100644 --- a/modules/programs/gh.nix +++ b/modules/programs/gh.nix @@ -137,7 +137,7 @@ in { home.activation.migrateGhAccounts = let ghHosts = "${config.xdg.configHome}/gh/hosts.yml"; in hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' - if [[ ! -L "${ghHosts}" && -f "${ghHosts}" ]]; then + if [[ ! -L "${ghHosts}" && -f "${ghHosts}" && $(grep --invert-match --quiet '^version:' ${ghHosts}) ]]; then ( TMP_DIR=$(mktemp -d) trap "rm --force --recursive $TMP_DIR" EXIT