From 28215db303535140f3d71c90dc616fb14f91325e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 13 Jan 2024 05:32:44 +0530 Subject: [PATCH] gh: only run migration when required --- modules/programs/gh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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