From 46833c3115e8858370880d892748f0927d8193c3 Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Mon, 22 Apr 2024 14:44:39 +0200 Subject: [PATCH] bat: allow overriding package (#5301) --- modules/programs/bat.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/bat.nix b/modules/programs/bat.nix index bf8040d1..5d09145a 100644 --- a/modules/programs/bat.nix +++ b/modules/programs/bat.nix @@ -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 ) ''; }