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

bat: allow overriding package

This commit is contained in:
Nicolas Goudry 2024-04-19 16:42:43 +02:00
parent 7ca7025cf2
commit d9ee839399
No known key found for this signature in database
GPG Key ID: 5FC434D9FFD1DF44

View File

@ -6,8 +6,6 @@ let
cfg = config.programs.bat;
package = pkgs.bat;
toConfigFile = attrs:
let
inherit (builtins) isBool attrNames;
@ -52,6 +50,8 @@ in {
'';
};
package = mkPackageOption pkgs "bat" { };
themes = mkOption {
type = types.attrsOf (types.either types.lines (types.submodule {
options = {
@ -138,7 +138,7 @@ in {
''];
})
{
home.packages = [ package ] ++ cfg.extraPackages;
home.packages = [ cfg.package ] ++ cfg.extraPackages;
xdg.configFile = mkMerge ([({
"bat/config" =
@ -167,7 +167,7 @@ in {
export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome}
verboseEcho "Rebuilding bat theme cache"
cd "${pkgs.emptyDirectory}"
run ${lib.getExe package} cache --build
run ${lib.getExe cfg.package} cache --build
)
'';
}