diff --git a/modules/hosts/t480/tmux-sessionizer.nix b/modules/hosts/t480/tmux-sessionizer.nix deleted file mode 100644 index 7e3b9589..00000000 --- a/modules/hosts/t480/tmux-sessionizer.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, ... }: - -{ - flake.modules.nixos."nixosConfigurations/t480".home-manager.users.${config.flake.meta.owner.username} = args: { - programs.tmux-sessionizer.searchPaths = - let - inherit (args.config.xdg) userDirs; - in - [ - "${userDirs.extraConfig.XDG_REPOS_DIR}:3" - "${userDirs.documents}:1" - "${args.config.home.homeDirectory}/tmp" - ]; - }; -} diff --git a/modules/scripts/clone.nix b/modules/scripts/clone.nix index 90457570..e254874c 100644 --- a/modules/scripts/clone.nix +++ b/modules/scripts/clone.nix @@ -25,13 +25,13 @@ user_path="$XDG_REPOS_DIR/$domain/$user" repo_path="$user_path/$name" - [[ -d "$repo_path" ]] && t "$repo_path" && exit 0 + [[ -d "$repo_path" ]] && tmux-sessionizer "$repo_path" && exit 0 mkdir -pv "$repo_path" git clone "$repo_url" "$repo_path" - t "$repo_path" + tmux-sessionizer "$repo_path" else exit 1 fi diff --git a/modules/tmux-sessionizer/default.nix b/modules/scripts/tmux-sessionizer/default.nix similarity index 100% rename from modules/tmux-sessionizer/default.nix rename to modules/scripts/tmux-sessionizer/default.nix diff --git a/modules/scripts/t.nix b/modules/scripts/tmux-sessionizer/package.nix similarity index 95% rename from modules/scripts/t.nix rename to modules/scripts/tmux-sessionizer/package.nix index 6ca8aa7b..1c92402b 100644 --- a/modules/scripts/t.nix +++ b/modules/scripts/tmux-sessionizer/package.nix @@ -4,9 +4,9 @@ { home.packages = [ (pkgs.writeShellApplication { - name = "t"; + name = "tmux-sessionizer"; - runtimeInputs = with pkgs; [ fzf ]; + runtimeInputs = with pkgs; [ coreutils fzf tmux ]; text = '' set -euo pipefail diff --git a/modules/tmux-sessionizer/config.nix b/modules/tmux-sessionizer/config.nix deleted file mode 100644 index 83b29d59..00000000 --- a/modules/tmux-sessionizer/config.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, ... }: - -{ - flake.modules.homeManager.base = - { config, ... }: - { - options.programs.tmux-sessionizer = { - searchPaths = lib.mkOption { - default = [ config.home.homeDirectory ]; - type = lib.types.listOf lib.types.str; - description = "List of search paths for tmux-sessionizer to use."; - }; - - # TODO: add TS_EXTRA_SEARCH_PATHS. - # TODO: add TS_MAX_DEPTH. - # TODO: add TS_SESSION_COMMANDS once I figure out what they're for. - }; - - config = { - xdg.configFile."tmux-sessionizer/tmux-sessionizer.conf".text = '' - TS_SEARCH_PATHS=(${builtins.concatStringsSep " " config.programs.tmux-sessionizer.searchPaths}) - TS_SESSION_COMMANDS=(nvim .) - ''; - }; - }; -} diff --git a/modules/tmux-sessionizer/package.nix b/modules/tmux-sessionizer/package.nix deleted file mode 100644 index d87d15d7..00000000 --- a/modules/tmux-sessionizer/package.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - flake.modules.homeManager.base = - { pkgs, ... }: - { - home.packages = with pkgs; [ tmux-sessionizer ]; - }; -} diff --git a/packages/tmux-sessionizer/default.nix b/packages/tmux-sessionizer/default.nix deleted file mode 100644 index f209ffdd..00000000 --- a/packages/tmux-sessionizer/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, ... }: - -with pkgs; - -stdenv.mkDerivation { - pname = "tmux-sessionizer"; - version = "unstable-2025-06-19"; - - src = fetchFromGitHub { - owner = "theprimeagen"; - repo = "tmux-sessionizer"; - rev = "7edf8211e36368c29ffc0d2c6d5d2d350b4d729b"; - sha256 = "sha256-4QGlq/cLbed7AZhQ3R1yH+44gmgp9gSzbiQft8X5NwU="; - }; - - buildInputs = [ - bash - fzf - tmux - ]; - - installPhase = '' - mkdir -p $out/bin - cp tmux-sessionizer $out/bin/tmux-sessionizer - chmod +x $out/bin/tmux-sessionizer - ''; - - patches = [ - (fetchpatch { - name = "Sort directories alphabetically #23"; - sha256 = "sha256-AtaOlV2JSeR0BmDsfuv8ZFbu5G0vz4RdUPY4ZF4UqQc="; - url = "https://patch-diff.githubusercontent.com/raw/ThePrimeagen/tmux-sessionizer/pull/23.patch"; - }) - - ./shorten-paths.patch - ]; -} diff --git a/packages/tmux-sessionizer/shorten-paths.patch b/packages/tmux-sessionizer/shorten-paths.patch deleted file mode 100644 index 2283b5fb..00000000 --- a/packages/tmux-sessionizer/shorten-paths.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/tmux-sessionizer b/tmux-sessionizer -index 036d2a3..cd11500 100755 ---- a/tmux-sessionizer -+++ b/tmux-sessionizer -@@ -252,7 +252,7 @@ find_dirs() { - if [[ -d "$path" ]]; then - while IFS= read -r dir; do - dir_list+=("$dir") -- done < <(find "$path" -mindepth 1 -maxdepth "$depth" -path '*/.git' -prune -o -type d -print) -+ done < <(find "$path" -mindepth 1 -maxdepth "$depth" -path '*/.git' -prune -o -type d -print | sed "s#$HOME/##" ) - fi - done - -@@ -341,6 +341,9 @@ fi - - if [[ "$selected" =~ ^\[TMUX\]\ (.+)$ ]]; then - selected="${BASH_REMATCH[1]}" -+else -+ # Re-add the Home directory back to the selected path. -+ selected="$HOME/$selected" - fi - - selected_name=$(basename "$selected" | tr . _)