Files
nix/modules/home-manager/programs/tmux.nix
Gustavo "Guz" L. de Mello cba902c988 feat: tmux-ssh-split
2024-01-26 18:32:33 -03:00

81 lines
2.3 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{ inputs, config, pkgs, lib, ... }:
let
cfg = config.tmux;
in
{
options.tmux = {
enable = lib.mkEnableOption "Enable Tmux module";
baseIndex = lib.mkOption {
type = lib.types.ints.unsigned;
default = 1;
};
prefix = lib.mkOption {
type = lib.types.str;
default = "C-Space";
};
shell = lib.mkOption {
type = lib.types.str;
default = "\${pkgs.bash}/bin/bash";
};
};
config = lib.mkIf cfg.enable {
programs.tmux.enable = true;
programs.tmux.baseIndex = cfg.baseIndex;
programs.tmux.keyMode = "vi";
programs.tmux.mouse = true;
programs.tmux.terminal = "screen-256color";
programs.tmux.prefix = cfg.prefix;
# TODO: package tmux plugins so tpm is not necessary
home.file."${config.xdg.configHome}/tmux/plugins/tpm" = {
source = inputs.tmux-plugin-manager;
};
home.packages = with pkgs; [
entr # b0o/tmux-autoreload depends on it
];
programs.tmux.extraConfig = ''
set -g @plugin 'b0o/tmux-autoreload'
set -g @plugin 'aserowy/tmux.nvim'
set -g @plugin 'guz013/frappuccino-tmux'
set -g @plugin 'pschmitt/tmux-ssh-split'
set -sg terminal-overrides ",*:RGB"
set -g renumber-windows on
bind -T prefix / split-window -v -c "#''''{pane_current_path}"
bind -T prefix \\ split-window -h -c "#''''{pane_current_path}"
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " "
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_status_modules_right "application directory session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{pane_current_path}"
run '${config.xdg.configHome}/tmux/plugins/tpm/tpm'
'';
};
}