14 src = fetchFromGitHub {
18 hash = "sha256-pTSC8ruNiPzQO1C6j+G+WFX3pz/mWPukuWkKUSYdfHw=";
21 modRoot = "./githooks";
22 vendorHash = "sha256-ZcDD4Z/thtyCvXg6GzzKC/FSbh700QEaqXU8FaZaZc4=";
24 nativeBuildInputs = [ makeWrapper ];
26 buildInputs = [ git ];
31 "-s" # Disable symbole table.
32 "-w" # Disable DWARF generation.
35 # We need to disable updates and other features:
36 # That is done with tag `package_manager_enabled`.
37 tags = [ "package_manager_enabled" ];
42 "TestGithooksCompliesWithGit" # Needs internet to download all hooks documentation.
43 "TestUpdateImages" # Needs docker/podman.
49 "(${builtins.concatStringsSep "|" skippedTests})"
54 # We need to generate some build files before building.
56 GH_BUILD_VERSION="${version}" \
57 GH_BUILD_TAG="v${version}" \
58 go generate -mod=vendor ./...
62 # Rename executable to proper names.
63 mv $out/bin/cli $out/bin/githooks-cli
64 mv $out/bin/runner $out/bin/githooks-runner
65 mv $out/bin/dialog $out/bin/githooks-dialog
69 wrapProgram "$out/bin/githooks-cli" --prefix PATH : ${lib.makeBinPath [ git ]}
70 wrapProgram "$out/bin/githooks-runner" --prefix PATH : ${lib.makeBinPath [ git ]}
73 passthru.tests.version = testers.testVersion {
75 command = "githooks-cli --version";
80 description = "Git hooks manager with per-repo and shared Git hooks including version control";
81 homepage = "https://github.com/gabyx/Githooks";
82 license = licenses.mpl20;
83 maintainers = with maintainers; [ gabyx ];
84 mainProgram = "githooks-cli";