From 2be731d5d2a98ce179d7754f4134d4afdae24470 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 18 Oct 2023 14:54:24 -0400 Subject: [PATCH] feat: add tmux hm module --- common/default.nix | 3 ++- common/modules/{git/default.nix => git.nix} | 0 common/modules/programs.nix | 24 --------------------- common/modules/tmux.nix | 24 +++++++++++++++++++++ hosts/binto/configuration.nix | 2 -- hosts/wim/configuration.nix | 2 -- 6 files changed, 26 insertions(+), 29 deletions(-) rename common/modules/{git/default.nix => git.nix} (100%) create mode 100644 common/modules/tmux.nix diff --git a/common/default.nix b/common/default.nix index e159da1..675d209 100644 --- a/common/default.nix +++ b/common/default.nix @@ -46,8 +46,9 @@ imports = [ nur.hmModules.nur ./modules/bash - ./modules/git + ./modules/git.nix ./modules/neovim + ./modules/tmux.nix ./hostvars.nix ({ osConfig, ... }: { diff --git a/common/modules/git/default.nix b/common/modules/git.nix similarity index 100% rename from common/modules/git/default.nix rename to common/modules/git.nix diff --git a/common/modules/programs.nix b/common/modules/programs.nix index 3ca43de..6bc11e1 100644 --- a/common/modules/programs.nix +++ b/common/modules/programs.nix @@ -22,28 +22,4 @@ ]; }; }; - - programs = { - # TODO: install plugins through nix - tmux = { - enable = true; - keyMode = "vi"; - terminal = "screen-256color"; - newSession = true; - historyLimit = 30000; - extraConfig = '' - bind-key -n Home send Escape "OH" - bind-key -n End send Escape "OF" - set -g mouse on - set -ga terminal-overrides ',xterm*:smcup@:rmcup@' - bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" - bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" - - set -g @plugin 'dracula/tmux' - run 'bash -c "$HOME/.tmux/plugins/tpm/tpm || - ${pkgs.git}/bin/git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm && - $HOME/.tmux/plugins/tpm/tpm"' - ''; - }; - }; } diff --git a/common/modules/tmux.nix b/common/modules/tmux.nix new file mode 100644 index 0000000..82a73c2 --- /dev/null +++ b/common/modules/tmux.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: { + programs = { + tmux = { + enable = true; + keyMode = "vi"; + terminal = "screen-256color"; + newSession = true; + historyLimit = 30000; + + plugins = with pkgs.tmuxPlugins; [ + dracula + ]; + + extraConfig = '' + bind-key -n Home send Escape "OH" + bind-key -n End send Escape "OF" + set -g mouse on + set -ga terminal-overrides ',xterm*:smcup@:rmcup@' + bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" + bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" + ''; + }; + }; +} diff --git a/hosts/binto/configuration.nix b/hosts/binto/configuration.nix index b961709..56dd58c 100644 --- a/hosts/binto/configuration.nix +++ b/hosts/binto/configuration.nix @@ -28,8 +28,6 @@ "libvirtd" ]; }; - - # TODO: use hm for tmux home-manager.users = { matt = { diff --git a/hosts/wim/configuration.nix b/hosts/wim/configuration.nix index e0c0317..5629446 100644 --- a/hosts/wim/configuration.nix +++ b/hosts/wim/configuration.nix @@ -31,8 +31,6 @@ "libvirtd" ]; }; - - # TODO: use hm for tmux home-manager.users = { matt = { imports = [