diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix index 10133a15..c224d5b0 100644 --- a/modules/home-manager/fish.nix +++ b/modules/home-manager/fish.nix @@ -1,5 +1,10 @@ { catppuccinLib }: -{ config, lib, ... }: +{ + config, + options, + lib, + ... +}: let inherit (config.catppuccin) sources; @@ -7,13 +12,22 @@ let cfg = config.catppuccin.fish; enable = cfg.enable && config.programs.fish.enable; - themeName = "Catppuccin ${lib.toSentenceCase cfg.flavor}"; + isLatte = cfg.flavor == "latte"; + flavor = if isLatte then "mocha" else cfg.flavor; + + themeName = "Catppuccin ${lib.toSentenceCase flavor}"; in { options.catppuccin.fish = catppuccinLib.mkCatppuccinOption { name = "fish"; }; config = lib.mkIf enable { + # if the user has explicitly chosen Latte, that means they probally haven't + # seen the note that latte is included in every theme, so lets warn them + warnings = lib.optional ( + isLatte && (options.catppuccin.fish.flavor.highestPrio != (lib.mkOptionDefault { }).priority) + ) "fish by default uses Latte as the light theme, defaulting to Mocha."; + xdg.configFile."fish/themes/${themeName}.theme".source = "${sources.fish}/${themeName}.theme"; programs.fish.shellInit = ''