added tmux module

This commit is contained in:
Bryan Ramos 2024-05-18 21:02:16 -04:00
parent 3e3d67e6bd
commit 37f704cc19
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
11 changed files with 101 additions and 13 deletions

View file

@ -0,0 +1,9 @@
''
case $- in
*i*)
if [ -z "$DISPLAY" ] && [ -z "$TMUX" ]; then
exec tmux
fi
;;
esac
''

View file

@ -0,0 +1,10 @@
''
bind -n M-C source-file ~/.config/tmux/tmux.conf
bind-key -n M-h select-pane -L
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-l select-pane -R
bind-key -n M-q kill-pane
''

View file

@ -0,0 +1,41 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.user.tmux;
gui = config.modules.user.gui.wm;
wm = {
enable = builtins.any (mod: mod.enable or false) (builtins.attrValues gui);
};
in
{ options.modules.user.tmux = { enable = mkEnableOption "Enable tmux module"; };
config = mkIf cfg.enable {
programs.bash = mkIf (!wm.enable) {
profileExtra = import ./config/shellHook.nix;
};
programs.tmux = {
enable = true;
newSession = true;
disableConfirmationPrompt = true;
keyMode = "vi";
mouse = if wm.enable then true else false;
prefix = "M";
shell = "\${pkgs.bash}/bin/bash";
plugins = with pkgs.tmuxPlugins; [
{
plugin = tilish;
extraConfig = ''
set -g @tilish-default 'tiled'
'';
}
];
extraConfig = import ./config/tmux.nix;
};
};
}