mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
bat: skip activation script if not needed
This commit is contained in:
parent
9b53a10f4c
commit
fb8b813438
1 changed files with 9 additions and 8 deletions
|
@ -162,14 +162,15 @@ in {
|
|||
# NOTE: run `bat cache --build` in an empty directory to work
|
||||
# around failure when ~/cache exists
|
||||
# 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"
|
||||
cd "${pkgs.emptyDirectory}"
|
||||
run ${lib.getExe cfg.package} cache --build
|
||||
)
|
||||
'';
|
||||
'');
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue