diff --git a/default.nix b/default.nix index e780a5a..98c23e6 100644 --- a/default.nix +++ b/default.nix @@ -27,4 +27,5 @@ ripgrep-all = pkgs.callPackage ./pkgs/ripgrep-all { inherit (pkgs.darwin.apple_sdk.frameworks) Security; }; + thumbs = pkgs.callPackage ./pkgs/thumbs { }; } diff --git a/pkgs/thumbs/default.nix b/pkgs/thumbs/default.nix new file mode 100644 index 0000000..4846834 --- /dev/null +++ b/pkgs/thumbs/default.nix @@ -0,0 +1,24 @@ +{ lib, rustPlatform, fetchFromGitHub }: + +rustPlatform.buildRustPackage rec { + pname = "thumbs"; + version = "0.5.1-infdev"; + + src = fetchFromGitHub { + owner = "FliegendeWurst"; + repo = "tmux-thumbs"; + rev = "60824a826a0f64403fd45ded9be8cf3a130476b2"; + sha256 = "sha256-3MKhZq2ks2rBYACf1kkfRxxXNexHjnQ6/+s1wCfqHeo="; + }; + + patches = [ ./fix.patch ]; + + cargoSha256 = "sha256-iPOEUd6+qPR1vI7khkHXgwR8UFRrCH5irHlL1VZVPyY="; + + meta = with lib; { + homepage = "https://github.com/FliegendeWurst/tmux-thumbs"; + description = "A lightning fast version copy/pasting like vimium/vimperator"; + license = licenses.mit; + maintainers = with maintainers; [ fliegendewurst ]; + }; +} diff --git a/pkgs/thumbs/fix.patch b/pkgs/thumbs/fix.patch new file mode 100644 index 0000000..e1d783c --- /dev/null +++ b/pkgs/thumbs/fix.patch @@ -0,0 +1,13 @@ +diff --git a/src/swapper.rs b/src/swapper.rs +index 6cf1e89..bcb0969 100644 +--- a/src/swapper.rs ++++ b/src/swapper.rs +@@ -215,7 +215,7 @@ impl<'a> Swapper<'a> { + }; + + let pane_command = format!( +- "tmux capture-pane -J -et {active_pane_id} -p{scroll_params} | tail -n {height} | {dir}/target/release/thumbs -f '%U:%H' -t {tmp} {args}; tmux swap-pane -t {active_pane_id}; {zoom_command} tmux wait-for -S {signal}", ++ "tmux capture-pane -J -et {active_pane_id} -p{scroll_params} | tail -n {height} | {dir}/thumbs -f '%U:%H' -t {tmp} {args}; tmux swap-pane -t {active_pane_id}; {zoom_command} tmux wait-for -S {signal}", + active_pane_id = active_pane_id, + scroll_params = scroll_params, + height = self.active_pane_height.unwrap_or(i32::MAX),