mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
treefmt isn't actually using flake-root to find the flake's root; it does it itself. All we were doing was passing flake-root's default `projectRootFile` to treefmt, which is `"flake.nix"`;
38 lines
794 B
Nix
38 lines
794 B
Nix
{ inputs, ... }:
|
|
{
|
|
imports = [
|
|
inputs.git-hooks.flakeModule
|
|
inputs.treefmt-nix.flakeModule
|
|
./devshell.nix
|
|
];
|
|
|
|
perSystem =
|
|
{ pkgs, config, ... }:
|
|
{
|
|
formatter = config.treefmt.build.wrapper;
|
|
|
|
treefmt.config = {
|
|
projectRootFile = "flake.nix";
|
|
package = pkgs.treefmt;
|
|
|
|
programs = {
|
|
nixfmt-rfc-style.enable = true;
|
|
statix.enable = true;
|
|
};
|
|
};
|
|
|
|
pre-commit = {
|
|
settings.hooks = {
|
|
nixfmt = {
|
|
package = pkgs.nixfmt-rfc-style;
|
|
enable = true;
|
|
};
|
|
statix = {
|
|
enable = true;
|
|
excludes = [ "plugins/lsp/language-servers/rust-analyzer-config.nix" ];
|
|
};
|
|
typos.enable = true;
|
|
};
|
|
};
|
|
};
|
|
}
|