1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-10 21:29:48 +01:00

gh: only run migration when required

This commit is contained in:
Harsh Shandilya 2024-01-13 05:32:44 +05:30 committed by Mikilio
parent bf8a128853
commit 28215db303
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -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