summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-01-08 23:23:28 +0530
committersinanmohd <sinan@sinanmohd.com>2024-01-08 23:24:51 +0530
commit119d8d504f435b552e548a9130ae96a2a3721dff (patch)
treed2f489e29e9f52f79228ba437cf3e5e5b54dc6bd
parent00cf70110af4661b20e19b1cd42eabc224abc573 (diff)
modules/tmux: init
-rw-r--r--common.nix1
-rw-r--r--hosts/kay/configuration.nix3
-rw-r--r--hosts/mox/configuration.nix3
-rw-r--r--modules/tmux.nix40
4 files changed, 43 insertions, 4 deletions
diff --git a/common.nix b/common.nix
index ff47d90..008301b 100644
--- a/common.nix
+++ b/common.nix
@@ -10,6 +10,7 @@ in
];
imports = [
./modules/userdata.nix
+ ./modules/tmux.nix
./modules/dev.nix
./modules/pppd.nix
./modules/network-interfaces-scripted.nix
diff --git a/hosts/kay/configuration.nix b/hosts/kay/configuration.nix
index e215353..b2a530e 100644
--- a/hosts/kay/configuration.nix
+++ b/hosts/kay/configuration.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ ... }:
{
imports = [
@@ -16,5 +16,4 @@
boot.consoleLogLevel = 3;
networking.hostName = "kay";
- environment.systemPackages = with pkgs; [ tmux ];
}
diff --git a/hosts/mox/configuration.nix b/hosts/mox/configuration.nix
index 8d66673..9b8c314 100644
--- a/hosts/mox/configuration.nix
+++ b/hosts/mox/configuration.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ ... }:
{
imports = [
@@ -15,5 +15,4 @@
boot.consoleLogLevel = 3;
networking.hostName = "mox";
- environment.systemPackages = with pkgs; [ tmux ];
}
diff --git a/modules/tmux.nix b/modules/tmux.nix
new file mode 100644
index 0000000..77e942d
--- /dev/null
+++ b/modules/tmux.nix
@@ -0,0 +1,40 @@
+{ pkgs, ... }:
+
+{
+ environment = {
+ systemPackages = with pkgs; [ tmux ];
+
+ etc."tmux.conf".text = ''
+ # base
+ set-option -g prefix C-a
+ unbind-key C-b
+ bind-key C-a send-prefix
+ setw -g pane-base-index 1
+ set -g history-limit 10000
+
+ # vim
+ set -g mode-keys vi
+ bind -T copy-mode-vi v send -X begin-selection
+ bind -T copy-mode-vi y send -X copy-selection
+ bind -r C-w last-window
+
+ bind -r h select-pane -L
+ bind -r j select-pane -D
+ bind -r k select-pane -U
+ bind -r l select-pane -R
+
+ bind -r H resize-pane -L 5
+ bind -r J resize-pane -D 5
+ bind -r K resize-pane -U 5
+ bind -r L resize-pane -R 5
+
+ bind -r C-h select-window -t :-
+ bind -r C-l select-window -t :+
+
+ # not eye candy
+ set -g status-style "bg=default fg=7"
+ set -g status-left ""
+ set -g status-right "#{session_name}"
+ '';
+ };
+}