2024-05-21 14:53:46 -07:00
|
|
|
{ config, lib, ... }:
|
2024-04-14 16:55:39 -07:00
|
|
|
let
|
2024-05-13 13:33:16 -07:00
|
|
|
inherit (config.catppuccin) sources;
|
|
|
|
|
2024-04-14 16:55:39 -07:00
|
|
|
cfg = config.programs.k9s.catppuccin;
|
|
|
|
enable = cfg.enable && config.programs.k9s.enable;
|
|
|
|
|
2024-04-23 10:42:45 -07:00
|
|
|
themeName = "catppuccin-${cfg.flavour}" + lib.optionalString cfg.transparent "-transparent";
|
|
|
|
themeFile = "${themeName}.yaml";
|
2024-04-14 16:55:39 -07:00
|
|
|
themePath = "/skins/${themeFile}";
|
|
|
|
theme = sources.k9s + "/dist/${themeFile}";
|
|
|
|
in
|
|
|
|
{
|
2024-05-21 14:53:46 -07:00
|
|
|
options.programs.k9s.catppuccin = lib.ctp.mkCatppuccinOpt "k9s" // {
|
|
|
|
transparent = lib.mkEnableOption "transparent version of flavour";
|
|
|
|
};
|
2024-04-14 16:55:39 -07:00
|
|
|
|
2024-05-21 14:53:46 -07:00
|
|
|
config = lib.mkIf enable {
|
|
|
|
xdg.configFile."k9s${themePath}".source = theme;
|
2024-04-14 16:55:39 -07:00
|
|
|
|
2024-05-21 14:53:46 -07:00
|
|
|
programs.k9s.settings.k9s.ui.skin = themeName;
|
|
|
|
};
|
2024-04-14 16:55:39 -07:00
|
|
|
}
|