2023-10-22 12:28:28 -07:00
|
|
|
{ config
|
|
|
|
, lib
|
2023-11-02 10:55:47 -07:00
|
|
|
, sources
|
2023-10-22 12:28:28 -07:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) ctp mkIf;
|
|
|
|
cfg = config.programs.fish.catppuccin;
|
|
|
|
enable = cfg.enable && config.programs.fish.enable;
|
|
|
|
|
|
|
|
themeName = "Catppuccin ${ctp.mkUpper cfg.flavour}";
|
2023-11-02 10:55:47 -07:00
|
|
|
themePath = "/themes/${themeName}.theme";
|
2023-10-22 12:28:28 -07:00
|
|
|
in
|
|
|
|
{
|
2023-11-02 10:55:47 -07:00
|
|
|
options.programs.fish.catppuccin = lib.ctp.mkCatppuccinOpt "fish";
|
2023-10-22 12:28:28 -07:00
|
|
|
|
|
|
|
# xdg is required for this to work
|
|
|
|
config = mkIf enable {
|
2023-11-02 10:55:47 -07:00
|
|
|
xdg = {
|
|
|
|
enable = lib.mkForce true;
|
|
|
|
|
|
|
|
configFile."fish${themePath}".source = "${sources.fish}${themePath}";
|
|
|
|
};
|
2023-10-22 12:28:28 -07:00
|
|
|
|
|
|
|
programs.fish.shellInit = ''
|
|
|
|
fish_config theme choose "${themeName}"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|