nixpkgs/pkgs/applications/version-management/lefthook/default.nix
2023-05-13 03:17:49 +00:00

44 lines
1.0 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
let
pname = "lefthook";
version = "1.3.13";
in
buildGoModule rec {
inherit pname version;
src = fetchFromGitHub {
owner = "evilmartians";
repo = "lefthook";
rev = "v${version}";
hash = "sha256-zEY8iFF3SyZrIWveUWW3dvWnZL4h7rQ8EcMNIcWJ5g8=";
};
vendorHash = "sha256-UMT39If9Oa7vgpkW2oltCUkaNQ0Qf1nCO5Z8F8SaajA=";
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 ];
};
}