Use the tmux-sessionizer from GitHub
Use the tmux-sessionizer code from GitHub instead of writing it myself and apply a patch to change the directories it uses to provide suggestions.
This commit is contained in:
parent
75efe1bf99
commit
5fd27efa50
4 changed files with 43 additions and 60 deletions
15
nix/pkgs/tmux-sessionizer/configure-directories.patch
Normal file
15
nix/pkgs/tmux-sessionizer/configure-directories.patch
Normal file
|
@ -0,0 +1,15 @@
|
|||
diff --git a/tmux-sessionizer b/tmux-sessionizer
|
||||
index fa1bec5..4d79e0b 100755
|
||||
--- a/tmux-sessionizer
|
||||
+++ b/tmux-sessionizer
|
||||
@@ -22,9 +22,7 @@ hydrate() {
|
||||
if [[ $# -eq 1 ]]; then
|
||||
selected=$1
|
||||
else
|
||||
- # If someone wants to make this extensible, i'll accept
|
||||
- # PR
|
||||
- selected=$(find ~/ ~/personal ~/personal/dev/env/.config -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||
+ selected=$(find -L ~/ ~/Code ~/Documents -mindepth 1 -maxdepth 1 -type d | sort | fzf)
|
||||
fi
|
||||
|
||||
if [[ -z $selected ]]; then
|
27
nix/pkgs/tmux-sessionizer/default.nix
Normal file
27
nix/pkgs/tmux-sessionizer/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "tmux-sessonizer";
|
||||
version = "0.1.0";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "theprimeagen";
|
||||
repo = "tmux-sessionizer";
|
||||
rev = "master";
|
||||
sha256 = "bZXt9TyMU1Ed/WR0/ahMQ4oyIi6yXLKnXKYPPNBt/s4=";
|
||||
};
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
bash
|
||||
fzf
|
||||
tmux
|
||||
];
|
||||
|
||||
patches = [ ./configure-directories.patch ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp tmux-sessionizer $out/bin/tmux-sessionizer
|
||||
chmod +x $out/bin/tmux-sessionizer
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue