tmux.nix
1 { 2 config, 3 lib, 4 pkgs, 5 ... 6 }: let 7 cfg = config.programs.tmux; 8 inherit (lib) mkEnableOption mkIf; 9 in { 10 options.programs.tmux.enable = mkEnableOption "tmux"; 11 12 config = mkIf cfg.enable { 13 hm = { 14 programs.tmux = { 15 enable = true; 16 shell = "${pkgs.nushell}/bin/nu"; 17 terminal = "tmux-256color"; 18 historyLimit = 100000; 19 escapeTime = 0; 20 keyMode = "vi"; 21 shortcut = "a"; 22 sensibleOnTop = true; 23 disableConfirmationPrompt = true; 24 baseIndex = 1; 25 mouse = true; 26 newSession = true; 27 28 extraConfig = '' 29 set -g allow-passthrough on 30 set -ga update-environment TERM 31 set -ga update-environment TERM_PROGRAM 32 set -g status-position top 33 set -g status-interval 1 34 35 36 37 ''; 38 39 plugins = with pkgs; [ 40 tmuxPlugins.sensible 41 { 42 plugin = tmuxPlugins.rose-pine; 43 extraConfig = '' 44 set -g @rose_pine_variant 'main' 45 set -g @rose_pine_date_time '%_I:%M %a %D' 46 set -g @rose_pine_show_pane_directory 'on' 47 set -g @rose_pine_status_left_prepend_section '#{tmux_mode_indicator}' 48 set -g @rose_pine_show_current_program 'on' 49 set -g @rose_pine_show_pane_directory 'on' 50 ''; 51 } 52 53 tmuxPlugins.pain-control 54 { 55 plugin = tmuxPlugins.mode-indicator; 56 extraConfig = '' 57 set -g @mode_indicator_prefix_prompt ' WAIT ' 58 set -g @mode_indicator_copy_prompt ' COPY ' 59 set -g @mode_indicator_sync_prompt ' SYNC ' 60 set -g @mode_indicator_empty_prompt ' TMUX ' 61 set -g @mode_indicator_prefix_mode_style 'bg=#191724,fg=blue' 62 set -g @mode_indicator_copy_mode_style 'bg=#191724,fg=yellow' 63 set -g @mode_indicator_sync_mode_style 'bg=#191724,fg=red' 64 set -g @mode_indicator_empty_mode_style 'bg=#191724,fg=cyan' 65 ''; 66 } 67 { 68 plugin = tmuxPlugins.extrakto; 69 extraConfig = '' 70 set -g @extrakto_clip_tool wl-copy 71 set -g @extrakto_editor hx 72 set -g @extrakto_open_tool floorp 73 set -g @extrakto_filter_order 'url path line word' 74 ''; 75 } 76 ]; 77 }; 78 }; 79 }; 80 }