feat(programs): add tmux
This commit is contained in:
parent
69454aba52
commit
52650a3c84
9 changed files with 67 additions and 1 deletions
|
|
@ -25,6 +25,7 @@
|
|||
./ssh.nix
|
||||
./sway.nix
|
||||
./thunar.nix
|
||||
./tmux.nix
|
||||
./zathura.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
|
|
|||
49
modules/programs/tmux.nix
Normal file
49
modules/programs/tmux.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.tmux;
|
||||
in
|
||||
{
|
||||
options.my.programs.tmux = {
|
||||
enable = mkEnableOption "tmux";
|
||||
autoAttach = mkEnableOption "autoAttach";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
my.shell.abbreviations.t = "tmux";
|
||||
home-manager.users.moritz.programs.tmux = {
|
||||
enable = true;
|
||||
clock24 = true;
|
||||
customPaneNavigationAndResize = true;
|
||||
keyMode = "vi";
|
||||
mouse = true;
|
||||
newSession = true;
|
||||
prefix = "C-Space";
|
||||
sensibleOnTop = false;
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
sensible
|
||||
tmux-fzf
|
||||
yank
|
||||
];
|
||||
};
|
||||
home-manager.users.moritz.programs = {
|
||||
fzf.tmux.enableShellIntegration = true;
|
||||
fish.interactiveShellInit =
|
||||
let
|
||||
insideVariables = [ "$TMUX" "$INSIDE_EMACS" "$EMACS" "$VIM" "$VSCODE_RESOLVING_ENVIRONMENT" ];
|
||||
insideVariableMissing = concatStringsSep " && " (map (x: "test -z ${x}") insideVariables);
|
||||
in
|
||||
mkIf cfg.autoAttach
|
||||
''
|
||||
if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing}
|
||||
if test -z $tmux_autostarted
|
||||
set -x tmux_autostarted true
|
||||
tmux a
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue