Closed domenkozar closed 7 months ago
- git.hooks.pre-commit.shellcheck.enable = true;
+ hooks.pre-commit.shellcheck.enable = true;
This way devenv can import it using git = mkOption { type = submodule pre-commit-hooks-module; }
and the flake parts module can import it in its own way. The latter needs to be explicit about the implementation in the prefix and pre-commit.settings.git.hooks
would kinda suck.
Isn't this the status quo actually?
Anyway, another nice thing would be to do
{
options.hooks = mkOption {
type = submodule {
freeformType = types.attrsOf hookModule;
};
};
}
and then declare built in hooks as something like
{
options.hooks.nixpkgs-fmt = mkOption {
type = submodule {
imports = [ hookModule ];
options.some-setting = mkOption ...;
};
};
}
thereby adding the individual hooks in the option docs, and removing the need for a separate settings namespace.
The redesigned pattern should have a package
option, so the tools
indirection becomes unnecessary, and overlays can be avoided. Refs https://github.com/cachix/pre-commit-hooks.nix/issues/204#issuecomment-1334165738
Eventually I'd like the interface to be:
hooks.ormolu.enable = true;
hooks.ormolu.package = pkgs.ormolu;
hooks.ormolu.settings.defaultExtensions = [ "lhs" "hs" ];
Merged to master!
Something like:
cc @roberth