1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 12:33:34 +02:00

bat: handle existing cache in activation script

Run `bat cache --build` in an empty directory to work around failure
when ~/cache exists.
This commit is contained in:
Matt Wittmann 2024-03-09 09:17:58 -08:00 committed by Robert Helgesson
parent fbec898387
commit fe4180ad3f
No known key found for this signature in database
GPG Key ID: 96E745BD17AA17ED

View File

@ -159,10 +159,14 @@ 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 = hm.dag.entryAfter [ "linkGeneration" ] ''
( (
export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome} export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome}
verboseEcho "Rebuilding bat theme cache" verboseEcho "Rebuilding bat theme cache"
cd "${pkgs.emptyDirectory}"
run ${lib.getExe package} cache --build run ${lib.getExe package} cache --build
) )
''; '';