From 2939d490366251d9ed5a0bd938275c590a1d6fa6 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 27 Dec 2023 15:02:56 +0530 Subject: [PATCH] gh: test for existence of hosts file Having the module enabled but never using gh will result in the config file existing but no hosts.yml. In that scenario we won't have anything to migrate, so only test for hosts.yml. --- 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 b56e8cfc3..b419791e6 100644 --- a/modules/programs/gh.nix +++ b/modules/programs/gh.nix @@ -136,7 +136,7 @@ in { # See https://github.com/nix-community/home-manager/issues/4744 for details. home.activation.migrateGhAccounts = hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' - if [[ -e "${config.xdg.configHome}/gh/config.yml" ]]; then + if [[ -e "${config.xdg.configHome}/gh/hosts.yml" ]]; then ( TMP_DIR=$(mktemp -d) trap "rm --force --recursive $TMP_DIR" EXIT