1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeWrapper,
6 installShellFiles,
7 git,
8 jq,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "git-worktree-switcher";
13 version = "0.2.4";
14
15 src = fetchFromGitHub {
16 owner = "mateusauler";
17 repo = "git-worktree-switcher";
18 tag = "${finalAttrs.version}-fork";
19 hash = "sha256-N+bDsLEUM6FWhyliUav2n5hwMa5EEuVPoIK+Cja0DxA=";
20 };
21
22 buildInputs = [
23 jq
24 git
25 ];
26
27 nativeBuildInputs = [
28 makeWrapper
29 installShellFiles
30 ];
31
32 patches = [
33 ./disable-update.patch # Disable update and auto update functionality
34 ];
35
36 installPhase = ''
37 mkdir -p $out/bin
38
39 cp wt $out/bin
40 wrapProgram $out/bin/wt --prefix PATH : ${
41 lib.makeBinPath [
42 git
43 jq
44 ]
45 }
46
47 installShellCompletion --zsh completions/_wt_completion
48 installShellCompletion --bash completions/wt_completion
49 installShellCompletion --fish completions/wt.fish
50 '';
51
52 meta = {
53 homepage = "https://github.com/mateusauler/git-worktree-switcher";
54 description = "Switch between git worktrees with speed";
55 license = lib.licenses.mit;
56 platforms = lib.platforms.all;
57 mainProgram = "wt";
58 maintainers = with lib.maintainers; [
59 jiriks74
60 mateusauler
61 ];
62 };
63})