From 1f4a72d28ccd0589c254fd350ebe02a8a40bb60c Mon Sep 17 00:00:00 2001 From: John Ogle Date: Fri, 3 Jan 2025 12:13:17 -0800 Subject: [PATCH] [tmux] Add tmux --- home/home-default.nix | 1 + home/modules/tmux/default.nix | 58 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 home/modules/tmux/default.nix diff --git a/home/home-default.nix b/home/home-default.nix index d611050..f1927b9 100644 --- a/home/home-default.nix +++ b/home/home-default.nix @@ -111,6 +111,7 @@ in ./modules/i3+sway ./modules/lutris ./modules/plasma-manager + ./modules/tmux ]; programs.bash.enable = true; diff --git a/home/modules/tmux/default.nix b/home/modules/tmux/default.nix new file mode 100644 index 0000000..a17f53c --- /dev/null +++ b/home/modules/tmux/default.nix @@ -0,0 +1,58 @@ +{ config, lib, pkgs, ... }: + +let + tokyo-night = pkgs.tmuxPlugins.mkTmuxPlugin { + pluginName = "tokyo-night"; + rtpFilePath = "tokyo-night.tmux"; + version = "1.6.1"; + src = pkgs.fetchFromGitHub { + owner = "janoamaral"; + repo = "tokyo-night-tmux"; + rev = "d610ced20d5f602a7995854931440e4a1e0ab780"; + sha256 = "sha256-17vEgkL7C51p/l5gpT9dkOy0bY9n8l0/LV51mR1k+V8="; + }; + }; +in +{ + programs.tmux.enable = true; + programs.tmux.escapeTime = 0; + programs.tmux.mouse = true; + programs.tmux.newSession = true; + programs.tmux.historyLimit = 50000; + programs.tmux.clock24 = true; + programs.tmux.baseIndex = 1; + programs.tmux.prefix = "`"; + + programs.tmux.extraConfig = '' + set -g mouse on + set -g default-terminal "screen-256color" + + bind -n S-Left previous-window + bind -n S-Right next-window + ''; + + programs.tmux.plugins = with pkgs; [ + tmuxPlugins.cpu + tmuxPlugins.battery + tmuxPlugins.better-mouse-mode + tmuxPlugins.net-speed + tmuxPlugins.online-status + tmuxPlugins.pain-control + tmuxPlugins.tilish + tmuxPlugins.yank + + { + plugin = tmuxPlugins.resurrect; + extraConfig = "set -g @resurrect-strategy-nvim 'session'"; + } + { + plugin = tmuxPlugins.continuum; + extraConfig = '' + set -g @continuum-restore 'on' + set -g @continuum-save-interval '15' # minutes + ''; + } + + tokyo-night + ]; +}