Per-hook flake output `check` derivations
gekoke opened this issue · 1 comments
gekoke commented
It would be nice if each hook could be built as a separate derivation. Currently, only one flake check
output with the name pre-commit
is produced.
If the hooks could be split into separate derivations, one could:
- run each check separately
- run checks in parallel in CI with tools like https://github.com/nix-community/nix-github-actions
- get more granular feedback for CI checks from GitHub's web UI
Is this something that is possible to implement? I understand there is the upstream dependency on pre-commit-hooks that might come into play here.
sandydoo commented
I suppose so. One thing to keep in mind is that there'll be a setup cost to pay for each check, not to mention the cost of launching a whole new job for each check.
git-hooks.nix/modules/pre-commit.nix
Lines 54 to 82 in 6fb82e4