depot/third_party/nixpkgs/pkgs/applications/version-management/lefthook/default.nix
Default email 0d9fc34957 Project import generated by Copybara.
GitOrigin-RevId: 5ed481943351e9fd354aeb557679624224de38d5
2023-01-20 11:41:00 +01:00

36 lines
1,023 B
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "lefthook";
version = "1.2.7";
src = fetchFromGitHub {
rev = "v${version}";
owner = "evilmartians";
repo = "lefthook";
sha256 = "sha256-bsPTOv1s/kU6UUxmmPpYC5Y9/YeR6LnuL09j1x5e3Es=";
};
vendorHash = "sha256-Dx9OL1D4VNfVQ0NUJr9aq54PXHecgMMtLg7GMFnQFCI=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [ "-s" "-w" ];
doCheck = false;
postInstall = ''
installShellCompletion --cmd lefthook \
--bash <($out/bin/lefthook completion bash) \
--fish <($out/bin/lefthook completion fish) \
--zsh <($out/bin/lefthook completion zsh)
'';
meta = with lib; {
description = "Fast and powerful Git hooks manager for any type of projects";
homepage = "https://github.com/evilmartians/lefthook";
changelog = "https://github.com/evilmartians/lefthook/raw/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ rencire ];
};
}