depot/third_party/nixpkgs/pkgs/applications/version-management/lefthook/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

43 lines
1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
let
pname = "lefthook";
version = "1.3.9";
in
buildGoModule rec {
inherit pname version;
src = fetchFromGitHub {
owner = "evilmartians";
repo = "lefthook";
rev = "v${version}";
hash = "sha256-6XsSnFrYRsVNzp5Kr1+GghbNh2uOOyT4BQm9yBw3jRU=";
};
vendorHash = "sha256-cMRl+TqSLlfoAja+JNaNKfHDR9fkvMTWdB1FT3XxPd4=";
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 = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [ AndersonTorres ];
};
}