diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index ee610e57..a4bac3b4 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -15,6 +15,7 @@ in ./bat.nix ./bottom.nix ./btop.nix + ./fish.nix ./kitty.nix ./lazygit.nix ./starship.nix diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix new file mode 100644 index 00000000..f851f222 --- /dev/null +++ b/modules/home-manager/fish.nix @@ -0,0 +1,32 @@ +{ config +, pkgs +, lib +, ... +}: +let + inherit (lib) ctp mkIf; + cfg = config.programs.fish.catppuccin; + enable = cfg.enable && config.programs.fish.enable; + + theme = pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "fish"; + rev = "91e6d6721362be05a5c62e235ed8517d90c567c9"; + sha256 = "sha256-l9V7YMfJWhKDL65dNbxaddhaM6GJ0CFZ6z+4R6MJwBA="; + }; + themeName = "Catppuccin ${ctp.mkUpper cfg.flavour}"; +in +{ + options.programs.fish.catppuccin = lib.ctp.mkCatppuccinOpt "fish" config; + + # xdg is required for this to work + config = mkIf enable { + xdg.enable = lib.mkForce true; + + programs.fish.shellInit = '' + fish_config theme choose "${themeName}" + ''; + xdg.configFile."fish/themes/${themeName}.theme".source = "${theme}/themes/${themeName}.theme"; + }; +}