From ef464d6dedebda5c9a96db2e451c86f813e7c868 Mon Sep 17 00:00:00 2001 From: Bernd Schorgers Date: Mon, 15 Apr 2024 01:55:39 +0200 Subject: [PATCH] feat(home-manager): init k9s module (#110) --- _sources/generated.json | 22 +++++++++++++++++++++- _sources/generated.nix | 12 ++++++++++++ modules/home-manager/k9s.nix | 28 ++++++++++++++++++++++++++++ nvfetcher.toml | 4 ++++ test.nix | 1 + 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 modules/home-manager/k9s.nix diff --git a/_sources/generated.json b/_sources/generated.json index fffbf69..97fc566 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -279,6 +279,26 @@ }, "version": "0317a097b6ec8122b1da6d02f61d0c5158019f6e" }, + "k9s": { + "cargoLocks": null, + "date": "2024-03-22", + "extract": null, + "name": "k9s", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "catppuccin", + "repo": "k9s", + "rev": "82eba6feb442932e28facedfb18dfbe79234f180", + "sha256": "sha256-VLi7G6Rjmbr6feSOg8aLYJmOb+GyJUKi3k9qod6ut9k=", + "type": "github" + }, + "version": "82eba6feb442932e28facedfb18dfbe79234f180" + }, "kitty": { "cargoLocks": null, "date": "2024-01-10", @@ -559,4 +579,4 @@ }, "version": "0adc53028d81bf047461bc61c43a484d11b15220" } -} \ No newline at end of file +} diff --git a/_sources/generated.nix b/_sources/generated.nix index abe9cca..ea6528a 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -169,6 +169,18 @@ }; date = "2024-01-17"; }; + k9s = { + pname = "k9s"; + version = "82eba6feb442932e28facedfb18dfbe79234f180"; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "k9s"; + rev = "82eba6feb442932e28facedfb18dfbe79234f180"; + fetchSubmodules = false; + sha256 = "sha256-VLi7G6Rjmbr6feSOg8aLYJmOb+GyJUKi3k9qod6ut9k="; + }; + date = "2024-03-22"; + }; kitty = { pname = "kitty"; version = "d7d61716a83cd135344cbb353af9d197c5d7cec1"; diff --git a/modules/home-manager/k9s.nix b/modules/home-manager/k9s.nix new file mode 100644 index 0000000..913c389 --- /dev/null +++ b/modules/home-manager/k9s.nix @@ -0,0 +1,28 @@ +{ config +, lib +, sources +, ... +}: +let + cfg = config.programs.k9s.catppuccin; + enable = cfg.enable && config.programs.k9s.enable; + + themeFile = "catppuccin-${cfg.flavour}.yaml"; + themePath = "/skins/${themeFile}"; + theme = sources.k9s + "/dist/${themeFile}"; +in +{ + options.programs.k9s.catppuccin = + lib.ctp.mkCatppuccinOpt "k9s"; + + config = lib.mkIf enable + { + assertions = [ + (lib.ctp.assertXdgEnabled "k9s") + ]; + + xdg.configFile."k9s${themePath}".source = theme; + + programs.k9s.settings.k9s.ui.skin = "catppuccin-${cfg.flavour}"; + }; +} diff --git a/nvfetcher.toml b/nvfetcher.toml index 2b89e54..a905179 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -54,6 +54,10 @@ fetch.github = "catppuccin/hyprland" src.git = "https://github.com/catppuccin/imv.git" fetch.github = "catppuccin/imv" +[k9s] +src.git = "https://github.com/catppuccin/k9s.git" +fetch.github = "catppuccin/k9s" + [kitty] src.git = "https://github.com/catppuccin/kitty.git" fetch.github = "catppuccin/kitty" diff --git a/test.nix b/test.nix index 8d31ab1..a65d956 100644 --- a/test.nix +++ b/test.nix @@ -67,6 +67,7 @@ in helix = ctpEnable; home-manager.enable = false; imv = ctpEnable; + k9s = ctpEnable; kitty = ctpEnable; lazygit = ctpEnable; micro = ctpEnable;