nixos/treefmt.nix

75 lines
2 KiB
Nix
Raw Normal View History

{
2025-07-13 06:04:55 +08:00
perSystem =
2025-11-07 23:54:49 +08:00
{ pkgs, lib, ... }:
2025-07-13 06:04:55 +08:00
{
treefmt = {
programs = {
nixfmt = {
enable = true;
excludes = [ "_sources/*.nix" ];
};
2025-07-13 06:04:55 +08:00
biome = {
enable = true;
includes = [ "*.json" ];
excludes = [ "_sources/*.json" ];
settings = {
javascript.formatter.enabled = false;
css.formatter.enabled = false;
};
};
2025-07-13 06:04:55 +08:00
dprint = {
enable = true;
includes = [
"*.md"
"*.toml"
"*.yaml"
];
excludes = [ "secrets/*.yaml" ];
settings = {
plugins = pkgs.dprint-plugins.getPluginList (
plugins: with plugins; [
dprint-plugin-toml
dprint-plugin-markdown
g-plane-pretty_yaml
]
);
};
};
just = {
enable = true;
includes = [ ".justfile" ];
};
typos =
let
2025-11-07 23:54:49 +08:00
config =
with lib;
pipe ./.typos.toml [
builtins.readFile
builtins.fromTOML
];
2025-07-13 06:04:55 +08:00
in
{
enable = true;
includes = [ "*" ];
excludes = [ "assets/*" ] ++ config.files.extend-exclude;
configFile = toString ./.typos.toml;
# Disable all extra option in treefmt module.
# Use config file.
sort = false;
isolated = false;
hidden = false;
noIgnore = false;
noIgnoreDot = false;
noIgnoreGlobal = false;
noIgnoreParent = false;
noIgnoreVCS = false;
binary = false;
noCheckFilenames = false;
noCheckFiles = false;
noUnicode = false;
};
};
};
};
}