2023-07-13 16:15:35 +00:00
|
|
|
{ config
|
|
|
|
, lib
|
2023-11-02 17:55:47 +00:00
|
|
|
, sources
|
2023-07-13 16:15:35 +00:00
|
|
|
, ...
|
|
|
|
}:
|
2023-04-16 00:13:47 +00:00
|
|
|
let
|
|
|
|
cfg = config.programs.btop.catppuccin;
|
2023-07-13 16:17:51 +00:00
|
|
|
enable = cfg.enable && config.programs.btop.enable;
|
|
|
|
|
2023-11-02 15:49:39 +00:00
|
|
|
themeFile = "catppuccin_${cfg.flavour}.theme";
|
|
|
|
themePath = "/themes/${themeFile}";
|
2023-11-02 17:55:47 +00:00
|
|
|
theme = sources.btop + themePath;
|
2023-04-19 00:01:16 +00:00
|
|
|
in
|
|
|
|
{
|
2023-04-17 16:44:07 +00:00
|
|
|
options.programs.btop.catppuccin =
|
2023-11-02 17:55:47 +00:00
|
|
|
lib.ctp.mkCatppuccinOpt "btop";
|
2023-04-16 00:13:47 +00:00
|
|
|
|
2023-11-02 17:55:47 +00:00
|
|
|
config = lib.mkIf enable
|
2023-07-13 16:15:35 +00:00
|
|
|
{
|
2023-11-03 17:25:24 +00:00
|
|
|
assertions = [
|
|
|
|
(lib.ctp.assertXdgEnabled "btop")
|
|
|
|
];
|
|
|
|
|
|
|
|
xdg.configFile."btop${themePath}".source = theme;
|
2023-04-16 00:13:47 +00:00
|
|
|
|
2023-11-02 15:49:39 +00:00
|
|
|
programs.btop.settings.color_theme = themeFile;
|
|
|
|
};
|
2023-04-16 00:13:47 +00:00
|
|
|
}
|