mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-01 00:24:59 +02:00
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
46 lines
939 B
Nix
46 lines
939 B
Nix
{ lib, inputs, ... }:
|
|
{
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
./devshell.nix
|
|
] ++ lib.optional (inputs.git-hooks ? flakeModule) inputs.git-hooks.flakeModule;
|
|
|
|
perSystem =
|
|
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
fmt = pkgs.nixfmt-rfc-style;
|
|
in
|
|
{
|
|
treefmt.config = {
|
|
projectRootFile = "flake.nix";
|
|
|
|
programs = {
|
|
nixfmt = {
|
|
enable = true;
|
|
package = fmt;
|
|
};
|
|
statix.enable = true;
|
|
};
|
|
};
|
|
}
|
|
// lib.optionalAttrs (inputs.git-hooks ? flakeModule) {
|
|
pre-commit = {
|
|
settings.hooks = {
|
|
nixfmt = {
|
|
enable = true;
|
|
package = fmt;
|
|
};
|
|
statix = {
|
|
enable = true;
|
|
excludes = [ "plugins/lsp/language-servers/rust-analyzer-config.nix" ];
|
|
};
|
|
typos.enable = true;
|
|
};
|
|
};
|
|
};
|
|
}
|