flake/dev: make git-hooks optional

as this isn't used by consumers, they should be able to remove this
input via `inputs.nixvim.inputs.git-hooks.follows = ""`. it is
especially important here as `git-hooks` has a large amount of inputs
itself
This commit is contained in:
seth 2024-07-07 15:21:08 -04:00
parent 2f21379b8c
commit 432a513ccd
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86

View file

@ -1,13 +1,17 @@
{ inputs, ... }:
{ lib, inputs, ... }:
{
imports = [
inputs.git-hooks.flakeModule
inputs.treefmt-nix.flakeModule
./devshell.nix
];
] ++ lib.optional (inputs.git-hooks ? flakeModule) inputs.git-hooks.flakeModule;
perSystem =
{ pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
fmt = pkgs.nixfmt-rfc-style;
in
@ -23,7 +27,8 @@
statix.enable = true;
};
};
}
// lib.optionalAttrs (inputs.git-hooks ? flakeModule) {
pre-commit = {
settings.hooks = {
nixfmt = {