{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.programs.tmux.rose-pine;
  enable = cfg.enable && config.programs.tmux.enable;
in {
  options.programs.tmux.rose-pine =
    lib.rp.mkRosePineOpt {name = "tmux";}
    // {
      extraConfig = lib.mkOption {
        type = lib.types.lines;
        description = "Additional configuration for the rose-pine plugin.";
        default = "";
        example = ''
          set -g @rose-pine "application session user host date_time"
        '';
      };
    };

  config.programs.tmux.plugins = lib.mkIf enable [
    {
      plugin = pkgs.tmuxPlugins.rose-pine;
      extraConfig = lib.concatStrings [
        ''
          set -g @rose_pine_variant '${cfg.flavor}'
        ''
        cfg.extraConfig
      ];
    }
  ];
}
