Improve pre-hooks
This commit is contained in:
parent
77f0e138a9
commit
60a0ceb192
5 changed files with 26 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Laptop configuration
|
# Laptop configuration
|
||||||
|
|
||||||
This repository has the Nix home-manager configuration for my laptop, allowing me to manage a user configuration with reproducibility on other machines. It currently operates on a foreign Linux distribution (Fedora Asahi Remix) with plans to switch to NixOS when time allows and to make it reusable for other systems. It uses `direnv` to automatically load the environment for running commands for this Flake.
|
This repository has the Nix home-manager configuration for my laptop, allowing me to manage a user configuration with reproducibility on other machines. It currently operates on a foreign Linux distribution (Fedora Asahi Remix) with plans to switch to NixOS when time allows and to make it reusable for other systems. `direnv` automatically loads the environment for running commands for this Flake.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -175,7 +175,15 @@
|
||||||
};
|
};
|
||||||
# https://flake.parts/options/git-hooks-nix.html
|
# https://flake.parts/options/git-hooks-nix.html
|
||||||
pre-commit.settings = {
|
pre-commit.settings = {
|
||||||
hooks = preCommitHooks;
|
hooks = preCommitHooks // {
|
||||||
|
treefmt = {
|
||||||
|
enable = true;
|
||||||
|
package = treefmt;
|
||||||
|
};
|
||||||
|
check-merge-conflicts.enable = true;
|
||||||
|
check-symlinks.enable = true;
|
||||||
|
flake-checker.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
# https://flake.parts/options/treefmt-nix.html
|
# https://flake.parts/options/treefmt-nix.html
|
||||||
treefmt = {
|
treefmt = {
|
||||||
|
|
|
@ -35,10 +35,20 @@ in
|
||||||
# https://writewithharper.com/docs/integrations/language-server#Supported-Languages
|
# https://writewithharper.com/docs/integrations/language-server#Supported-Languages
|
||||||
harper-ls.command = "${pkgs.harper}/bin/harper-ls";
|
harper-ls.command = "${pkgs.harper}/bin/harper-ls";
|
||||||
};
|
};
|
||||||
|
pre-commit = {
|
||||||
|
typos = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
configPath = typosConfigFile.outPath;
|
||||||
|
locale = "en-us";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
vale.enable = true;
|
||||||
|
};
|
||||||
treefmt.programs.typos = {
|
treefmt.programs.typos = {
|
||||||
enable = true;
|
enable = true;
|
||||||
locale = "en-us";
|
|
||||||
configFile = typosConfigFile.outPath;
|
configFile = typosConfigFile.outPath;
|
||||||
|
locale = "en-us";
|
||||||
};
|
};
|
||||||
devshell = {
|
devshell = {
|
||||||
commands = [
|
commands = [
|
||||||
|
|
|
@ -20,4 +20,5 @@
|
||||||
language-server.taplo.command = "${pkgs.taplo}/bin/taplo";
|
language-server.taplo.command = "${pkgs.taplo}/bin/taplo";
|
||||||
};
|
};
|
||||||
treefmt.programs.taplo.enable = true;
|
treefmt.programs.taplo.enable = true;
|
||||||
|
pre-commit.check-toml.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,8 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.plugins = [ "g-plane-pretty_yaml" ];
|
settings.plugins = [ "g-plane-pretty_yaml" ];
|
||||||
};
|
};
|
||||||
|
pre-commit = {
|
||||||
|
check-yaml.enable = true;
|
||||||
|
sort-simple-yaml.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue