feat: Change nix formatter to alejandra

This commit is contained in:
ulic-youthlic 2025-11-09 06:25:03 +08:00
parent 0b8b647f05
commit b4c3dfec42
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
229 changed files with 2528 additions and 2884 deletions

View file

@ -1,74 +1,74 @@
{
perSystem =
{ pkgs, lib, ... }:
{
treefmt = {
programs = {
nixfmt = {
enable = true;
excludes = [ "_sources/*.nix" ];
perSystem = {
pkgs,
lib,
...
}: {
treefmt = {
programs = {
alejandra = {
enable = true;
excludes = ["_sources/*.nix"];
};
biome = {
enable = true;
includes = ["*.json"];
excludes = ["_sources/*.json"];
settings = {
javascript.formatter.enabled = false;
css.formatter.enabled = false;
};
biome = {
enable = true;
includes = [ "*.json" ];
excludes = [ "_sources/*.json" ];
settings = {
javascript.formatter.enabled = false;
css.formatter.enabled = false;
};
};
dprint = {
enable = true;
includes = [
"*.md"
"*.toml"
"*.yaml"
];
excludes = [ "secrets/*.yaml" ];
settings = {
plugins = pkgs.dprint-plugins.getPluginList (
plugins: with plugins; [
};
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
config =
with lib;
pipe ./.typos.toml [
builtins.readFile
builtins.fromTOML
];
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;
};
};
just = {
enable = true;
includes = [".justfile"];
};
typos = let
config = with lib;
pipe ./.typos.toml [
builtins.readFile
builtins.fromTOML
];
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;
};
};
};
};
}