dotfiles/nix/modules/home-manager/features/cli/tmux-sessionizer.nix
Oliver Davies 434c40597b Don't exit on error
As this file is sourced, it affects all subsequent shells created in the
current session.
2024-12-16 17:12:33 +00:00

42 lines
766 B
Nix

{
config,
lib,
pkgs,
...
}:
with lib;
{
options.features.cli.tmux-sessionizer.enable = mkEnableOption "Enable tmux-sessionizer";
config = mkIf config.features.cli.tmux-sessionizer.enable {
home.packages = with pkgs; [ tmux-sessionizer ];
home.file.".tmux-sessionizer".source = "${
pkgs.writeShellApplication {
name = ".tmux-sessionizer";
runtimeInputs = with pkgs; [
tmux
];
text = ''
set +o errexit
set +o nounset
if [[ "$PWD" == "$REPOS/os" || "$PWD" == "$REPOS/personal" ]]; then
clear
return
fi
tmux new-window -d -n shell
nvim
clear
'';
}
}/bin/.tmux-sessionizer";
};
}