From 7736586670db0591a83f954ace08d0ef9a313505 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Thu, 30 Jun 2022 14:07:02 +0100 Subject: [PATCH] Added tmux to dingserver --- hosts/common/default.nix | 9 ------- hosts/dingserver/configuration.nix | 1 + hosts/dingserver/tmux.nix | 38 ++++++++++++++++++++++++++++++ users/daniel/default.nix | 3 +++ 4 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 hosts/dingserver/tmux.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 24ccdd8..71d703a 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -64,15 +64,6 @@ EDITOR = "hx"; }; - programs.zsh = { - enable = true; - ohMyZsh = { - enable = true; - plugins = ["git" "fzf"]; - theme = "agnoster"; - }; - }; - services = { openssh.enable = true; diff --git a/hosts/dingserver/configuration.nix b/hosts/dingserver/configuration.nix index 4ce19e0..c27d84e 100644 --- a/hosts/dingserver/configuration.nix +++ b/hosts/dingserver/configuration.nix @@ -11,6 +11,7 @@ ./caddy.nix ./synapse.nix ./prometheus.nix + ./tmux.nix ]; # Force disable the common boot loader diff --git a/hosts/dingserver/tmux.nix b/hosts/dingserver/tmux.nix new file mode 100644 index 0000000..d9fe5a1 --- /dev/null +++ b/hosts/dingserver/tmux.nix @@ -0,0 +1,38 @@ +{...}: { + programs.tmux = { + enable = true; + keyMode = "vi"; + terminal = "tmux-256color"; + escapeTime = 0; + baseIndex = 1; + historyLimit = 10000; + clock24 = true; + extraConfig = '' + unbind-key -a -T prefix + unbind-key -a -T root + unbind-key -a -T copy-mode + unbind-key -a -T copy-mode-vi + + set -g prefix M-w + + bind q detach + bind space copy-mode + bind -T copy-mode-vi Escape send-keys -X cancel + + bind -T copy-mode-vi Escape send -X cancel + bind -T copy-mode-vi k send -X cursor-up + bind -T copy-mode-vi j send -X cursor-down + bind -T copy-mode-vi h send -X cursor-left + bind -T copy-mode-vi l send -X cursor-right + + bind -T copy-mode-vi Space send -X begin-selection + bind -T copy-mode-vi y send -X copy-selection-no-clear + bind -T copy-mode-vi Enter send -X copy-selection-and-cancel + + set -g mouse on + bind -n WheelUpPane copy-mode -e + bind -T copy-mode-vi WheelUpPane send -X -N 5 scroll-up + bind -T copy-mode-vi WheelDownPane send -X -N 5 scroll-down + ''; + }; +} diff --git a/users/daniel/default.nix b/users/daniel/default.nix index b060938..d19f5e9 100644 --- a/users/daniel/default.nix +++ b/users/daniel/default.nix @@ -150,6 +150,9 @@ in { enable = true; enableAutosuggestions = true; initExtra = '' + if [ -n "$TMUX" ]; then + setopt ignoreeof + fi eval "$(direnv hook zsh)" ''; oh-my-zsh = {