2024-08-23 03:53:12 -07:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-10-20 10:37:57 -07:00
|
|
|
}: let
|
|
|
|
inherit (config.rose-pine) sources;
|
2024-05-13 13:33:16 -07:00
|
|
|
|
2024-10-20 10:37:57 -07:00
|
|
|
cfg = config.programs.k9s.rose-pine;
|
2024-04-14 16:55:39 -07:00
|
|
|
enable = cfg.enable && config.programs.k9s.enable;
|
|
|
|
|
2024-08-23 03:53:12 -07:00
|
|
|
# NOTE: On MacOS specifically, k9s expects its configuration to be in
|
2024-10-20 10:37:57 -07:00
|
|
|
# `~/Library/Application Support` when not using XDG.
|
2024-08-23 03:53:12 -07:00
|
|
|
enableXdgConfig = !pkgs.stdenv.hostPlatform.isDarwin || config.xdg.enable;
|
|
|
|
|
2024-10-20 10:37:57 -07:00
|
|
|
themeFile = "rose-pine.yaml";
|
2024-08-23 03:53:12 -07:00
|
|
|
themePath = "k9s/skins/${themeFile}";
|
2024-10-20 10:37:57 -07:00
|
|
|
theme = sources.k9s + "/skin.yml";
|
|
|
|
in {
|
|
|
|
options.programs.k9s.rose-pine = lib.rp.mkRosePineOpt {name = "k9s";};
|
2024-04-14 16:55:39 -07:00
|
|
|
|
2024-08-23 03:53:42 -07:00
|
|
|
config = lib.mkIf enable (
|
|
|
|
lib.mkMerge [
|
|
|
|
(lib.mkIf (!enableXdgConfig) {
|
|
|
|
home.file."Library/Application Support/${themePath}".source = theme;
|
|
|
|
})
|
2024-10-20 10:37:57 -07:00
|
|
|
(lib.mkIf enableXdgConfig {
|
|
|
|
xdg.configFile.${themePath}.source = theme;
|
|
|
|
})
|
|
|
|
|
|
|
|
{
|
|
|
|
programs.k9s.settings.k9s.ui.skin = "rose-pine";
|
|
|
|
}
|
2024-08-23 03:53:42 -07:00
|
|
|
]
|
|
|
|
);
|
2024-04-14 16:55:39 -07:00
|
|
|
}
|