tmux-sessionizer: paths option

This commit is contained in:
Zynh Ludwig 2024-08-07 04:31:21 -07:00
parent 20d33b0483
commit c85f5e013b

View file

@ -11,6 +11,19 @@ in
snowhawk.tmux.sessionizer = {
enable = lib.mkEnableOption "tmux-sessionizer home-manager module";
paths = lib.mkOption {
type = with lib.types; listOf str;
description = ''
list of paths to select with tmux-sessionizer
'';
default = [ ];
example = [
"~"
"~/projects"
"~/src"
];
};
pkg = lib.mkOption {
type = lib.types.package;
description = ''
@ -35,7 +48,7 @@ in
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(${find} -L ~/projects ~/ ~/.config ~/src -mindepth 1 -maxdepth 1 -type d | ${fzf})
selected=$(${find} -L ${lib.escapeShellArgs cfg.paths} -mindepth 1 -maxdepth 1 -type d | ${fzf})
fi
if [[ -z $selected ]]; then