diff --git a/pkgs/by-name/la/lazyworktree/package.nix b/pkgs/by-name/la/lazyworktree/package.nix new file mode 100644 index 000000000000..347e2876237a --- /dev/null +++ b/pkgs/by-name/la/lazyworktree/package.nix @@ -0,0 +1,55 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + installShellFiles, + versionCheckHook, + nix-update-script, +}: + +buildGoModule (finalAttrs: { + pname = "lazyworktree"; + version = "1.17.0"; + + src = fetchFromGitHub { + owner = "chmouel"; + repo = "lazyworktree"; + tag = "v${finalAttrs.version}"; + hash = "sha256-5e/GnGpNCK/Tqs71UKei2sbnQ5c3MRuNod3VTNodKGM="; + }; + + vendorHash = "sha256-6TVCpD7xKN7giFhZXInKkohoML+usnzAJ5+4yDBjzJA="; + + nativeBuildInputs = [ installShellFiles ]; + + # Tests require git and are integration tests + doCheck = false; + + ldflags = [ + "-s" + "-w" + "-X main.version=${finalAttrs.version}" + ]; + + postInstall = '' + install -Dm444 shell/functions.shell -t $out/share/lazyworktree + installManPage lazyworktree.1 + ''; + + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "BubbleTea-based Terminal User Interface for efficient Git worktree management"; + homepage = "https://github.com/chmouel/lazyworktree"; + changelog = "https://github.com/chmouel/lazyworktree/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + chmouel + vdemeester + ]; + mainProgram = "lazyworktree"; + }; +})