rose-pine-nix/modules/home-manager/btop.nix
Sefa Eyeoglu a0e508260c
refactor(home-manager): ensure xdg.enable using assertion (#59)
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-11-03 13:25:24 -04:00

28 lines
562 B
Nix

{ config
, lib
, sources
, ...
}:
let
cfg = config.programs.btop.catppuccin;
enable = cfg.enable && config.programs.btop.enable;
themeFile = "catppuccin_${cfg.flavour}.theme";
themePath = "/themes/${themeFile}";
theme = sources.btop + themePath;
in
{
options.programs.btop.catppuccin =
lib.ctp.mkCatppuccinOpt "btop";
config = lib.mkIf enable
{
assertions = [
(lib.ctp.assertXdgEnabled "btop")
];
xdg.configFile."btop${themePath}".source = theme;
programs.btop.settings.color_theme = themeFile;
};
}