dotfiles/nix/modules/home-manager/features/cli/tmux-sessionizer.nix

41 lines
748 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
2024-12-10 21:40:33 +00:00
with lib;
{
2024-12-10 21:40:33 +00:00
options.features.cli.tmux-sessionizer.enable = mkEnableOption "Enable tmux-sessionizer";
2024-12-10 21:40:33 +00:00
config = mkIf config.features.cli.tmux-sessionizer.enable {
home.packages = with pkgs; [ custom-tmux-sessionizer ];
home.file.".tmux-sessionizer".source = "${
pkgs.writeShellApplication {
name = ".tmux-sessionizer";
runtimeInputs = with pkgs; [
tmux
];
text = ''
set +o nounset
2024-12-07 00:20:47 +00:00
if [[ "$PWD" == "$REPOS/os" || "$PWD" == "$REPOS/personal" ]]; then
clear
return
fi
2024-12-07 02:37:01 +00:00
tmux new-window -d -n shell
nvim
clear
'';
}
}/bin/.tmux-sessionizer";
};
}