From 4e1edb7a3805ea68e8ddb2f009a955f3cefa9adb Mon Sep 17 00:00:00 2001 From: Igor Rzegocki Date: Thu, 3 Oct 2024 19:01:32 +0200 Subject: [PATCH] kubecolor: init --- flake.lock | 24 ++++++------- modules/kubecolor/hm.nix | 76 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 modules/kubecolor/hm.nix diff --git a/flake.lock b/flake.lock index 895afdaf..2d4e4b3e 100644 --- a/flake.lock +++ b/flake.lock @@ -53,11 +53,11 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1731949548, - "narHash": "sha256-XIDexXM66sSh5j/x70e054BnUsviibUShW7XhbDGhYo=", + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", "owner": "tinted-theming", "repo": "base16-vim", - "rev": "61165b1632409bd55e530f3dbdd4477f011cadc6", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", "type": "github" }, "original": { @@ -69,11 +69,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1732722421, + "narHash": "sha256-HRJ/18p+WoXpWJkcdsk9St5ZiukCqSDgbOGFa8Okehg=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "9ed2ac151eada2306ca8c418ebd97807bb08f6ac", "type": "github" }, "original": { @@ -142,11 +142,11 @@ ] }, "locked": { - "lastModified": 1732482255, - "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", + "lastModified": 1733085484, + "narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=", "owner": "nix-community", "repo": "home-manager", - "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", + "rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163", "type": "github" }, "original": { @@ -157,11 +157,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732238832, - "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", + "lastModified": 1733064805, + "narHash": "sha256-7NbtSLfZO0q7MXPl5hzA0sbVJt6pWxxtGWbaVUDDmjs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", + "rev": "31d66ae40417bb13765b0ad75dd200400e98de84", "type": "github" }, "original": { diff --git a/modules/kubecolor/hm.nix b/modules/kubecolor/hm.nix new file mode 100644 index 00000000..b5ef2465 --- /dev/null +++ b/modules/kubecolor/hm.nix @@ -0,0 +1,76 @@ +{ config, lib, ... }: + +with config.lib.stylix.colors.withHashtag; + +{ + options.stylix.targets.kubecolor.enable = + config.lib.stylix.mkEnableTarget "kubecolor" true; + + config = lib.mkIf config.stylix.targets.kubecolor.enable { + programs.kubecolor.settings = { + preset = if config.stylix.polarity == "either" then "" else "${config.stylix.polarity}"; + theme = { + base = { + info = "fg=${base05-hex}"; + primary = "fg=${base0E-hex}"; + secondary = "fg=${base0D-hex}"; + success = "fg=${base0B-hex}:bold"; + warning = "fg=${base0A-hex}:bold"; + danger = "fg=${base08-hex}:bold"; + muted = "fg=${base04-hex}"; + key = "fg=${base07-hex}:bold"; + }; + default = "fg=${base05-hex}"; + data = { + key = "fg=${base07-hex}:bold"; + string = "fg=${base05-hex}"; + true = "fg=${base0B-hex}:bold"; + false = "fg=${base08-hex}:bold"; + number = "fg=${base0E-hex}"; + null = "fg=${base04-hex}"; + quantity = "fg=${base0E-hex}"; + duration = "fg=${base09-hex}"; + durationfresh = "fg=${base0B-hex}"; + ratio = { + zero = "fg=${base04-hex}"; + equal = "fg=${base0B-hex}"; + unequal = "fg=${base0A-hex}"; + }; + }; + status = { + success = "fg=${base0B-hex}:bold"; + warning = "fg=${base0A-hex}:bold"; + error = "fg=${base08-hex}:bold"; + }; + table = { + header = "fg=${base05-hex}:bold"; + columns = "fg=${base05-hex}"; + }; + stderr = { + default = "fg=${base05-hex}"; + error = "fg=${base08-hex}:bold"; + }; + describe = { + key = "fg=${base07-hex}:bold"; + }; + apply = { + created = "fg=${base0B-hex}"; + configured = "fg=${base0A-hex}"; + unchanged = "fg=${base05-hex}"; + dryrun = "fg=${base0D-hex}"; + fallback = "fg=${base05-hex}"; + }; + explain = { + key = "fg=${base07-hex}:bold"; + required = "fg=${base00-hex}:bold"; + }; + options = { + flag = "fg=${base07-hex}:bold"; + }; + version = { + key = "fg=${base07-hex}:bold"; + }; + }; + }; + }; +}