2024-10-19 17:37:49 -07:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (config.rose-pine) sources;
|
|
|
|
cfg = config.programs.btop.rose-pine;
|
2023-07-13 09:17:51 -07:00
|
|
|
enable = cfg.enable && config.programs.btop.enable;
|
|
|
|
|
2024-10-19 17:37:49 -07:00
|
|
|
themeFile =
|
|
|
|
if (cfg.flavor == "main")
|
|
|
|
then "rose-pine.theme"
|
|
|
|
else "rose-pine-${cfg.flavor}.theme";
|
|
|
|
themePath = "/${themeFile}";
|
2023-11-02 10:55:47 -07:00
|
|
|
theme = sources.btop + themePath;
|
2024-10-19 17:37:49 -07:00
|
|
|
in {
|
|
|
|
options.programs.btop.rose-pine = lib.rp.mkRosePineOpt {name = "btop";};
|
2023-04-15 17:13:47 -07:00
|
|
|
|
2024-05-21 14:53:46 -07:00
|
|
|
config = lib.mkIf enable {
|
2024-10-19 17:37:49 -07:00
|
|
|
xdg.configFile."btop/themes${themePath}".source = theme;
|
2023-04-15 17:13:47 -07:00
|
|
|
|
2024-05-21 14:53:46 -07:00
|
|
|
programs.btop.settings.color_theme = themeFile;
|
|
|
|
};
|
2023-04-15 17:13:47 -07:00
|
|
|
}
|