diff --git a/modules/pre-commit.nix b/modules/pre-commit.nix index d3e5b393..5262e099 100644 --- a/modules/pre-commit.nix +++ b/modules/pre-commit.nix @@ -172,7 +172,12 @@ let configFile = runCommand "pre-commit-config.json" { - buildInputs = [ pkgs.jq ]; + buildInputs = [ + pkgs.jq + # needs to be an input so we regenerate the config and reinstall the hooks + # when the package changes + cfg.package + ]; passAsFile = [ "rawJSON" ]; rawJSON = builtins.toJSON cfg.rawConfig; } ''