rose-pine-nix/modules/home-manager/bat.nix
seth 60a1d9ba22
refactor: use alternatives to with and rec (#38)
* fix(home-manager): dont declare xdg.configFile when btop isn't enabled

* refactor: use alternatives to `with` and `rec`

---------

Co-authored-by: Sam Nystrom <sam@samnystrom.dev>
2023-07-13 12:17:51 -04:00

27 lines
666 B
Nix

{ config
, pkgs
, lib
, ...
}:
let
cfg = config.programs.bat.catppuccin;
enable = cfg.enable && config.programs.bat.enable;
in
{
options.programs.bat.catppuccin =
lib.ctp.mkCatppuccinOpt "bat" config;
config = {
programs.bat = lib.mkIf enable {
config.theme = "Catppuccin-${cfg.flavour}";
themes."Catppuccin-${cfg.flavour}" = builtins.readFile (pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "bat";
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
}
+ "/Catppuccin-${cfg.flavour}.tmTheme");
};
};
}