git-hooks.nix
git-hooks.nix copied to clipboard
create a custom pre-commit install command which ensures the store paths used land in a derivation and are protected from gc
The .pre-commit-config.yaml symlink produced by the shellHook script is already a GC root. Does it not work for you? EDIT: WRONG
@roberth then i missed a detail - as per #160 i'd like to use a out of the checkout conifg file
if the in checkout file is also being used as gc root, then its a slightly different handling
@roberth i just hada nix gc destroy my pre-commit hook as installed, is there a way to fix that ?
@roberth what i observe is that practically every nix gc call wll destroy the pre commit hooks, including the config files
what can be done to sort that out?
I wrongly assumed the symlink was a gc root. I didn't find a good solution for creating one. See https://github.com/NixOS/nix/issues/7138
Mine don't get GC-ed because lorri creates gc roots for the shells that reference them. Lorri shouldn't be a requirement though.