rose-pine-nix/modules/home-manager/tmux.nix
seth 28e6d8a18d
feat(modules): add catppuccin.sources option (#129)
* feat(modules): add `catppuccin.sources` option

* refactor(modules)!: nvfetcher -> npins

npins gives us a nicer file to import that is a simple name value pair
of the port and the path in the store. this allows for easier overriding
with the catppuccin.sources option

* fix(modules): ensure default sources are applied to `catppuccin.sources`
2024-05-13 16:33:16 -04:00

45 lines
1 KiB
Nix

{ config
, lib
, pkgs
, ...
}:
let
inherit (lib) ctp mkOption types concatStrings;
inherit (config.catppuccin) sources;
cfg = config.programs.tmux.catppuccin;
enable = cfg.enable && config.programs.tmux.enable;
plugin =
# TODO @getchoo: upstream this in nixpkgs
pkgs.tmuxPlugins.mkTmuxPlugin {
pluginName = "catppuccin";
version = builtins.substring 0 7 sources.tmux.revision;
src = sources.tmux;
};
in
{
options.programs.tmux.catppuccin =
ctp.mkCatppuccinOpt "tmux"
// {
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"
'';
};
};
config.programs.tmux.plugins = lib.mkIf enable [
{
inherit plugin;
extraConfig = concatStrings [
''
set -g @catppuccin_flavour '${cfg.flavour}'
''
cfg.extraConfig
];
}
];
}