From 1a044a5256cd6ae07d7a0ca855595238fd5dfdfe Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Fri, 28 Mar 2025 22:50:43 -0700 Subject: [PATCH] Migrate Tmux config to Nix --- nix/home.nix | 2 +- nix/modules/dotfiles.nix | 1 - nix/modules/tmux.nix | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 nix/modules/tmux.nix diff --git a/nix/home.nix b/nix/home.nix index e96d40e..7a4c0e5 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -23,7 +23,6 @@ htop ncdu ripgrep - tmux nerd-fonts.fira-code roboto-mono ]; @@ -38,6 +37,7 @@ ./modules/tealdeer.nix ./modules/work.nix ./modules/dotfiles.nix + ./modules/tmux.nix ]; fonts.fontconfig.enable = true; diff --git a/nix/modules/dotfiles.nix b/nix/modules/dotfiles.nix index dc53360..98207c1 100644 --- a/nix/modules/dotfiles.nix +++ b/nix/modules/dotfiles.nix @@ -6,7 +6,6 @@ let dotdir = "${config.home.homeDirectory}/.dotfiles"; in { xdg.configFile = { - "tmux/tmux.conf".source = ../../tmux.conf; "vim/vimrc".source = ../../vimrc; "ideavim/ideavimrc".source = ../../ideavimrc; # "doom".source = mkOutOfStoreSymlink "${dotdir}/doom"; diff --git a/nix/modules/tmux.nix b/nix/modules/tmux.nix new file mode 100644 index 0000000..94557fe --- /dev/null +++ b/nix/modules/tmux.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: +{ + programs.tmux = { + enable = true; + mouse = true; + shortcut = "s"; + baseIndex = 1; + keyMode = "vi"; + customPaneNavigationAndResize = true; + + plugins = with pkgs; [ + tmuxPlugins.sensible + ]; + + extraConfig = '' +# Splitting panes +bind - split-window -v -c '#{pane_current_path}' +bind \\ split-window -h -c '#{pane_current_path}' + +# New window at current path +bind c new-window -c '#{pane_current_path}' + +# Break pane into new window +bind b break-pane -d + +# Status bar themeing +set-option -g status-bg '#666666' +set-option -g status-fg '#aaaaaa' + +# Toggle mouse-mode +bind m set-window-option mouse +''; + }; +}