From 2ac9832ef38bb8f5b378056e9ba0d2b54f250976 Mon Sep 17 00:00:00 2001 From: mactep Date: Wed, 7 Jan 2026 16:50:26 -0300 Subject: [PATCH] fix(home-manager): handle latte with dynamic themes --- modules/home-manager/fish.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 = ''