feat(k9s): Catppuccin -> Rose Pine

This commit is contained in:
punkfairie 2024-10-20 10:37:57 -07:00
parent 6cd932a7fa
commit 4c8ed054c1
Signed by: punkfairie
GPG key ID: 01823C057725C266
2 changed files with 28 additions and 16 deletions

View file

@ -156,6 +156,18 @@
"url": "https://github.com/catppuccin/k9s/archive/fdbec82284744a1fc2eb3e2d24cb92ef87ffb8b4.tar.gz",
"hash": "0cs7j1z0xq66w0700qcrc6ynzmw3bdr422p1rnkl7hxq8g4a67zn"
},
"k9s-theme": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "sasoria",
"repo": "k9s-theme"
},
"branch": "main",
"revision": "4ed8c473f16642b894bb501f1cd979fb670cce2d",
"url": "https://github.com/sasoria/k9s-theme/archive/4ed8c473f16642b894bb501f1cd979fb670cce2d.tar.gz",
"hash": "17lrv30wiql6i0ll33wng9ziizlzg9kx0wa960i900crfcq94168"
},
"lazygit": {
"type": "Git",
"repository": {
@ -446,4 +458,4 @@
}
},
"version": 3
}
}

View file

@ -3,34 +3,34 @@
lib,
pkgs,
...
}:
let
inherit (config.catppuccin) sources;
}: let
inherit (config.rose-pine) sources;
cfg = config.programs.k9s.catppuccin;
cfg = config.programs.k9s.rose-pine;
enable = cfg.enable && config.programs.k9s.enable;
# NOTE: On MacOS specifically, k9s expects its configuration to be in
# `~/Library/Application Support` when not using XDG
# `~/Library/Application Support` when not using XDG.
enableXdgConfig = !pkgs.stdenv.hostPlatform.isDarwin || config.xdg.enable;
themeName = "catppuccin-${cfg.flavor}" + lib.optionalString cfg.transparent "-transparent";
themeFile = "${themeName}.yaml";
themeFile = "rose-pine.yaml";
themePath = "k9s/skins/${themeFile}";
theme = sources.k9s + "/dist/${themeFile}";
in
{
options.programs.k9s.catppuccin = lib.ctp.mkCatppuccinOpt { name = "k9s"; } // {
transparent = lib.mkEnableOption "transparent version of flavor";
};
theme = sources.k9s + "/skin.yml";
in {
options.programs.k9s.rose-pine = lib.rp.mkRosePineOpt {name = "k9s";};
config = lib.mkIf enable (
lib.mkMerge [
(lib.mkIf (!enableXdgConfig) {
home.file."Library/Application Support/${themePath}".source = theme;
})
(lib.mkIf enableXdgConfig { xdg.configFile.${themePath}.source = theme; })
{ programs.k9s.settings.k9s.ui.skin = themeName; }
(lib.mkIf enableXdgConfig {
xdg.configFile.${themePath}.source = theme;
})
{
programs.k9s.settings.k9s.ui.skin = "rose-pine";
}
]
);
}