1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2025-02-17 05:35:06 +01:00

bat: skip activation script if not needed

This commit is contained in:
Dawid Dziurla 2024-06-03 09:10:40 +02:00
parent 9b53a10f4c
commit fb8b813438
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

View file

@ -162,14 +162,15 @@ in {
# NOTE: run `bat cache --build` in an empty directory to work # NOTE: run `bat cache --build` in an empty directory to work
# around failure when ~/cache exists # around failure when ~/cache exists
# https://github.com/sharkdp/bat/issues/1726 # https://github.com/sharkdp/bat/issues/1726
home.activation.batCache = hm.dag.entryAfter [ "linkGeneration" ] '' home.activation.batCache = mkIf (cfg.syntaxes != { } || cfg.themes != { })
( (hm.dag.entryAfter [ "linkGeneration" ] ''
export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome} (
verboseEcho "Rebuilding bat theme cache" export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome}
cd "${pkgs.emptyDirectory}" verboseEcho "Rebuilding bat theme cache"
run ${lib.getExe cfg.package} cache --build cd "${pkgs.emptyDirectory}"
) run ${lib.getExe cfg.package} cache --build
''; )
'');
} }
]); ]);
} }