chore: Use nixfmt reformat all nix source code

This commit is contained in:
ulic-youthlic 2026-07-04 23:11:21 +08:00
parent 1cdf00cefe
commit 11337b8f9e
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
184 changed files with 2349 additions and 1943 deletions

View file

@ -1,45 +1,62 @@
{
perSystem = {lib, ...}: {
perSystem = { lib, ... }: {
treefmt.programs = {
alejandra = {
nixfmt = {
enable = true;
excludes = ["_sources/*.nix"];
};
oxfmt = let
oxfmtConfig = with lib;
pipe ./.oxfmtrc.json [builtins.readFile builtins.fromJSON];
in {
enable = true;
includes = ["*.json" "*.md" "*.toml" "*.yaml"];
excludes = oxfmtConfig.ignorePatterns;
excludes = [ "_sources/*.nix" ];
};
oxfmt =
let
oxfmtConfig =
with lib;
pipe ./.oxfmtrc.json [
builtins.readFile
builtins.fromJSON
];
in
{
enable = true;
includes = [
"*.json"
"*.md"
"*.toml"
"*.yaml"
];
excludes = oxfmtConfig.ignorePatterns;
};
just = {
enable = true;
includes = [".justfile"];
};
typos = let
config = with lib;
pipe ./.typos.toml [builtins.readFile 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;
includes = [ ".justfile" ];
};
typos =
let
config =
with lib;
pipe ./.typos.toml [
builtins.readFile
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;
};
};
};
}