mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 02:38:38 +02:00
as this isn't used by consumers, they should be able to remove this input via `inputs.nixvim.inputs.treefmt-nix.follows = ""`
46 lines
1 KiB
Nix
46 lines
1 KiB
Nix
{ lib, inputs, ... }:
|
|
{
|
|
imports =
|
|
[ ./devshell.nix ]
|
|
++ lib.optional (inputs.git-hooks ? flakeModule) inputs.git-hooks.flakeModule
|
|
++ lib.optional (inputs.treefmt-nix ? flakeModule) inputs.treefmt-nix.flakeModule;
|
|
|
|
perSystem =
|
|
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
fmt = pkgs.nixfmt-rfc-style;
|
|
in
|
|
lib.optionalAttrs (inputs.treefmt-nix ? flakeModule) {
|
|
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;
|
|
};
|
|
};
|
|
};
|
|
}
|