2024-05-21 14:53:46 -07:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2023-07-13 09:17:51 -07:00
|
|
|
}:
|
2023-04-15 17:22:31 -07:00
|
|
|
let
|
2024-05-21 14:53:46 -07:00
|
|
|
inherit (lib)
|
|
|
|
ctp
|
|
|
|
mkOption
|
|
|
|
types
|
|
|
|
concatStrings
|
|
|
|
;
|
2024-05-13 13:33:16 -07:00
|
|
|
inherit (config.catppuccin) sources;
|
2023-04-15 17:22:31 -07:00
|
|
|
cfg = config.programs.tmux.catppuccin;
|
2023-07-13 09:17:51 -07:00
|
|
|
enable = cfg.enable && config.programs.tmux.enable;
|
2023-04-15 17:22:31 -07:00
|
|
|
|
2023-11-02 10:55:47 -07:00
|
|
|
plugin =
|
|
|
|
# TODO @getchoo: upstream this in nixpkgs
|
|
|
|
pkgs.tmuxPlugins.mkTmuxPlugin {
|
2023-04-15 17:22:31 -07:00
|
|
|
pluginName = "catppuccin";
|
2024-05-13 13:33:16 -07:00
|
|
|
version = builtins.substring 0 7 sources.tmux.revision;
|
2023-11-02 10:55:47 -07:00
|
|
|
src = sources.tmux;
|
2023-04-15 17:22:31 -07:00
|
|
|
};
|
2023-04-18 17:01:16 -07:00
|
|
|
in
|
|
|
|
{
|
2024-06-28 09:29:30 -07:00
|
|
|
options.programs.tmux.catppuccin = ctp.mkCatppuccinOpt { name = "tmux"; } // {
|
2024-05-21 14:53:46 -07:00
|
|
|
extraConfig = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
description = "Additional configuration for the catppuccin plugin.";
|
|
|
|
default = "";
|
|
|
|
example = ''
|
|
|
|
set -g @catppuccin_status_modules_right "application session user host date_time"
|
|
|
|
'';
|
2024-05-13 10:59:12 -07:00
|
|
|
};
|
2024-05-21 14:53:46 -07:00
|
|
|
};
|
2023-04-15 17:22:31 -07:00
|
|
|
|
2023-07-13 09:17:51 -07:00
|
|
|
config.programs.tmux.plugins = lib.mkIf enable [
|
2023-04-15 17:22:31 -07:00
|
|
|
{
|
|
|
|
inherit plugin;
|
2024-05-13 10:59:12 -07:00
|
|
|
extraConfig = concatStrings [
|
|
|
|
''
|
2024-08-18 15:35:31 -07:00
|
|
|
set -g @catppuccin_flavor '${cfg.flavor}'
|
2024-05-13 10:59:12 -07:00
|
|
|
''
|
|
|
|
cfg.extraConfig
|
|
|
|
];
|
2023-04-15 17:22:31 -07:00
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|