From bdc4336b37a1c261307fab6e349c816249c43abe Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 15 Apr 2023 19:46:20 -0400 Subject: [PATCH] feat(home-manager): add support for kitty (#19) --- modules/home-manager/default.nix | 1 + modules/home-manager/kitty.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 modules/home-manager/kitty.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 09f196d..4fc2cc3 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -2,6 +2,7 @@ imports = [ ./bat.nix ./bottom.nix + ./kitty.nix ./starship.nix ./helix.nix ./gtk.nix diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix new file mode 100644 index 0000000..8be64db --- /dev/null +++ b/modules/home-manager/kitty.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: +let cfg = config.programs.kitty.catppuccin; +in { + options.programs.kitty.catppuccin = with lib; { + enable = mkEnableOption "Catppuccin theme"; + flavour = mkOption { + type = types.enum [ "latte" "frappe" "macchiato" "mocha" ]; + default = config.catppuccin.flavour; + description = "Catppuccin flavour for kitty"; + }; + }; + + config.programs.kitty = with lib; + let + # string -> string + # this capitalizes the first letter in a string + # it's used to set the theme name correctly here + mkUpper = word: + (toUpper (substring 0 1 word)) + (substring 1 (stringLength word) word); + + flavourUpper = mkUpper cfg.flavour; + in mkIf cfg.enable { theme = "Catppuccin-${flavourUpper}"; }; +}