Add extraPackages to each hook and propagate them to enabledPackages#430
Add extraPackages to each hook and propagate them to enabledPackages#430domenkozar merged 3 commits intocachix:masterfrom
extraPackages to each hook and propagate them to enabledPackages#430Conversation
This lets additional runtime packages like formatters for `treefmt` be propagated to `enabledPackages` for use in a developer environment.
|
Shouldn't we just propagate |
|
I'm also not quite sure how that would work with e.g. |
We should remove It's sole purpose is to provide an access point to override specific dependencies for hooks that have them. And the reason it's an attrset and not a list of packages (like
Yeah, @domenkozar, I quite like this actually. |
sandydoo
left a comment
There was a problem hiding this comment.
LGTM!
The only question I have is whether we might want to mark this as internal? But then it won't show up in the docs at all, which is annoying if you're writing a custom hook. 🤷 Probably good as it is.
I've argued for a category of "advanced" options, a middle ground, but that's controversial, in the context of NixOS at least. |
|
We could also replace |
That's what we're doing now, no? Or do you have something else in mind? git-hooks.nix/modules/hooks.nix Lines 176 to 185 in 40e6053 |
Co-authored-by: sander <sandermel94@gmail.com>
Oh, I see. I thought it was an arbitrary attrset of packages for some reason. Maybe we should remove the |
Maybe 🤷 The extra level excludes the (admittedly unlikely) possibility of naming conflicts with other pre-commit options. |
enabledPackagescan be used to include all the relevant packages for enabled hooks into a developer environment. Unfortunately, it doesn't automatically pick up on packages other than a hook's defaultpackageattribute. By adding anextraPackagesoption to each hook, these other packages can be seamlessly added to developer environments.I've included defaults for
extraPackagesfor the following hooks:treefmt: the enabledsettings.formattersclippy,rustfmt: thepackageOverridesdune-fmt: the enabledsettings.extraRuntimeInputs