Add treefmt-nix for formatting all the files
This commit is contained in:
parent
1a9a4243fe
commit
ceecc82aae
11 changed files with 151 additions and 52 deletions
66
flake.nix
66
flake.nix
|
|
@ -133,6 +133,12 @@
|
|||
utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
treefmt-nix = {
|
||||
type = "github";
|
||||
owner = "numtide";
|
||||
repo = "treefmt-nix";
|
||||
};
|
||||
};
|
||||
outputs = {
|
||||
self,
|
||||
|
|
@ -153,6 +159,7 @@
|
|||
systems = flake-utils.lib.defaultSystems;
|
||||
imports = [
|
||||
inputs.home-manager.flakeModules.home-manager
|
||||
inputs.treefmt-nix.flakeModule
|
||||
nixos
|
||||
home
|
||||
deploy
|
||||
|
|
@ -169,11 +176,10 @@
|
|||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
formatter = pkgs.alejandra;
|
||||
packages = import ./pkgs (
|
||||
args
|
||||
// {
|
||||
inherit inputs;
|
||||
inherit inputs rootPath;
|
||||
}
|
||||
);
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
|
@ -185,6 +191,62 @@
|
|||
nvfetcher
|
||||
];
|
||||
};
|
||||
treefmt = {
|
||||
programs = {
|
||||
alejandra = {
|
||||
enable = true;
|
||||
excludes = ["pkgs/_sources/*.nix"];
|
||||
};
|
||||
biome = {
|
||||
enable = true;
|
||||
includes = ["*.json"];
|
||||
excludes = ["pkgs/_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-plugin-toml
|
||||
dprint-plugin-markdown
|
||||
g-plane-pretty_yaml
|
||||
]);
|
||||
};
|
||||
};
|
||||
just = {
|
||||
enable = true;
|
||||
includes = [".justfile"];
|
||||
};
|
||||
typos = let
|
||||
config = ./.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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
flake = {
|
||||
overlays = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue