From 432a513ccd26286c34596a5b15f5ab1f4c0fc04b Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 7 Jul 2024 15:21:08 -0400 Subject: [PATCH] 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 --- flake-modules/dev/default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/flake-modules/dev/default.nix b/flake-modules/dev/default.nix index 3fe66798..2116d035 100644 --- a/flake-modules/dev/default.nix +++ b/flake-modules/dev/default.nix @@ -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 = {