This commit is contained in:
1 parent
9110789527
commit
be62f224a6
1 file changed
+16
-21
+16
-21
@@ -9,6 +9,9 @@ let
|
|||||||
|
|
||||||
pre-commit-check = git-hooks.lib.${system}.run {
|
pre-commit-check = git-hooks.lib.${system}.run {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
|
default_stages = [ "pre-commit" ];
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
nixfmt = {
|
nixfmt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -16,32 +19,24 @@ let
|
|||||||
};
|
};
|
||||||
statix.enable = true;
|
statix.enable = true;
|
||||||
deadnix.enable = true;
|
deadnix.enable = true;
|
||||||
|
|
||||||
|
flake-check = {
|
||||||
|
enable = true;
|
||||||
|
entry = "${pkgs.lib.getExe pkgs.nix} flake check";
|
||||||
|
stages = [ "pre-push" ];
|
||||||
|
pass_filenames = false;
|
||||||
|
always_run = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
checks = {
|
checks.pre-commit-check = pre-commit-check;
|
||||||
inherit pre-commit-check;
|
|
||||||
};
|
|
||||||
|
|
||||||
formatter =
|
formatter = pkgs.nixfmt-tree;
|
||||||
let
|
|
||||||
inherit (pre-commit-check) config;
|
|
||||||
inherit (config) package configFile;
|
|
||||||
script = ''
|
|
||||||
${pkgs.lib.getExe package} run --all-files --config ${configFile}
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
pkgs.writeShellScriptBin "pre-commit-run" script;
|
|
||||||
|
|
||||||
devShells = {
|
devShells.default = pkgs.mkShell {
|
||||||
default =
|
inherit (pre-commit-check) shellHook;
|
||||||
let
|
packages = pre-commit-check.enabledPackages;
|
||||||
inherit (pre-commit-check) shellHook enabledPackages;
|
|
||||||
in
|
|
||||||
pkgs.mkShell {
|
|
||||||
inherit shellHook;
|
|
||||||
buildInputs = enabledPackages;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user