This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
treefmt/nix/treefmt.nix
2023-12-23 13:06:50 +00:00

47 lines
937 B
Nix

{inputs, ...}: {
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = {config, ...}: {
treefmt.config = {
inherit (config.flake-root) projectRootFile;
flakeCheck = true;
flakeFormatter = true;
programs = {
alejandra.enable = true;
deadnix.enable = true;
gofumpt.enable = true;
prettier.enable = true;
statix.enable = true;
};
settings.formatter.prettier = {
options = ["--tab-width" "4"];
includes = [
"*.css"
"*.html"
"*.js"
"*.json"
"*.jsx"
"*.md"
"*.mdx"
"*.scss"
"*.ts"
"*.yaml"
];
};
};
devshells.default = {
commands = [
{
category = "formatting";
name = "fmt";
help = "format the repo";
command = "nix fmt";
}
];
};
};
}