git-hooks.nix icon indicating copy to clipboard operation
git-hooks.nix copied to clipboard

Is there a way to get the packages used by hooks as nix devshell inputs?

Open Janik-Haag opened this issue 2 years ago • 1 comments

Basically what I want to do is define the pre-commit-hooks with this project and then want to add them to my devshells buildInputs. Is there a way to do that, that isn't writing them double?

Janik-Haag avatar Sep 20 '23 16:09 Janik-Haag

This seems like a good candidate for #196

domenkozar avatar Oct 08 '23 13:10 domenkozar

With #196 implemented, is this now possible or is there something else that needs to be done to get access to the packages used in pre-commit-hooks?

tljuniper avatar Mar 20 '24 07:03 tljuniper

Wow, that was fast! Thanks for taking a look!

The new flake.nix example in the README currently fails with error: attribute 'enabledPackages' missing when I paste it into an empty directory and run nix develop.

The default.nix + shell.nix examples fail with error: undefined variable 'pkgs'.

tljuniper avatar Mar 20 '24 08:03 tljuniper

Can you try again with the flakes?

domenkozar avatar Mar 20 '24 08:03 domenkozar

Works now. Thank you so much!

tljuniper avatar Mar 20 '24 08:03 tljuniper

ohh was wondering why was enabledPackages missing too.. I just had to update the flake :)

danielgafni avatar Mar 20 '24 12:03 danielgafni