2023-04-12 12:48:02 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "lefthook";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.6.14";
|
2023-04-12 12:48:02 +00:00
|
|
|
in
|
2024-02-07 01:22:34 +00:00
|
|
|
buildGoModule {
|
2023-04-12 12:48:02 +00:00
|
|
|
inherit pname version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-04-25 03:57:28 +00:00
|
|
|
owner = "evilmartians";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "lefthook";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-forbMU7KiPWtO79XMAuckt5wzJFQehqAZ5IYNv6Tr7I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
vendorHash = "sha256-M5lIfgUYMwLJu5NB54aZLofEegZiW+AUoSaVOul1ud8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd lefthook \
|
|
|
|
--bash <($out/bin/lefthook completion bash) \
|
|
|
|
--fish <($out/bin/lefthook completion fish) \
|
|
|
|
--zsh <($out/bin/lefthook completion zsh)
|
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fast and powerful Git hooks manager for any type of projects";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://github.com/evilmartians/lefthook";
|
|
|
|
changelog = "https://github.com/evilmartians/lefthook/raw/v${version}/CHANGELOG.md";
|
2023-04-12 12:48:02 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-08-10 07:59:29 +00:00
|
|
|
mainProgram = "lefthook";
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|