added stuff
This commit is contained in:
parent
6d31f5b5a1
commit
7d4f626b7d
907 changed files with 70990 additions and 0 deletions
53
nyx/flake/pre-commit.nix
Normal file
53
nyx/flake/pre-commit.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{inputs, ...}: {
|
||||
imports = [inputs.pre-commit-hooks.flakeModule];
|
||||
|
||||
perSystem = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
# configure a general exclude list
|
||||
excludes = ["flake.lock" "r'.+\.age$'" "r'.+\.sh$'"];
|
||||
|
||||
# mkHook just defaults failfast to true
|
||||
# and sets the description from the name
|
||||
mkHook = name: prev:
|
||||
{
|
||||
inherit excludes;
|
||||
description = "pre-commit hook for ${name}";
|
||||
fail_fast = true; # running hooks if this hook fails
|
||||
verbose = true;
|
||||
}
|
||||
// prev;
|
||||
in {
|
||||
pre-commit = {
|
||||
check.enable = true;
|
||||
|
||||
settings = {
|
||||
# inherit the global exclude list
|
||||
inherit excludes;
|
||||
|
||||
# hooks that we want to enable
|
||||
hooks = {
|
||||
alejandra = mkHook "Alejandra" {enable = true;};
|
||||
actionlint = mkHook "actionlint" {enable = true;};
|
||||
luacheck = mkHook "luacheck" {enable = true;};
|
||||
treefmt = mkHook "treefmt" {enable = true;};
|
||||
|
||||
editorconfig-checker = mkHook "editorconfig" {
|
||||
enable = false;
|
||||
always_run = true;
|
||||
};
|
||||
|
||||
prettier = mkHook "prettier" {
|
||||
enable = true;
|
||||
settings = {
|
||||
binPath = "${pkgs.prettierd}/bin/prettierd";
|
||||
write = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue