From c85f5e013b61de9ef0ed67579d9a7dd8857db371 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Wed, 7 Aug 2024 04:31:21 -0700 Subject: [PATCH] tmux-sessionizer: paths option --- home/modules/tmux-sessionizer.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/home/modules/tmux-sessionizer.nix b/home/modules/tmux-sessionizer.nix index 65e9556..01c10c3 100644 --- a/home/modules/tmux-sessionizer.nix +++ b/home/modules/tmux-sessionizer.nix @@ -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