Extract a tmux mixin

This commit is contained in:
Oliver Davies 2025-04-05 10:20:16 +01:00
parent 111c336abc
commit 3ff9d54970
10 changed files with 120 additions and 162 deletions

View file

@ -1,41 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
{
options.homeManagerModules.tmux-sessionizer.enable = mkEnableOption "Enable tmux-sessionizer";
config = mkIf config.homeManagerModules.tmux-sessionizer.enable {
home.packages = with pkgs; [ tmux-sessionizer ];
home.file."${config.xdg.configHome}/tmux-sessionizer/default".source = "${
pkgs.writeShellApplication {
name = ".tmux-sessionizer";
runtimeInputs = with pkgs; [
tmux
];
text = ''
set +o errexit
set +o nounset
if [[ "$PWD" == "$XDG_REPOS_DIR/os" || "$PWD" == "$XDG_REPOS_DIR/personal" ]]; then
clear
return
fi
tmux new-window -d -n scratch
nvim .
clear
'';
}
}/bin/.tmux-sessionizer";
};
}