nix-community.nixvim/flake-modules/dev/default.nix
Matt Sturgeon ec78d2e1ab
flake-modules: drop flake-root
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"`;
2024-06-05 09:09:07 +01:00

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;
};
};
};
}