Configure git-hooks-nix

This commit is contained in:
Oliver Davies 2025-06-22 23:17:37 +01:00
parent 6d65e70fe3
commit 6c3ab477e0
6 changed files with 112 additions and 1 deletions

16
nix/modules/git-hooks.nix Normal file
View file

@ -0,0 +1,16 @@
{ inputs, ... }:
{
imports = [
inputs.git-hooks-nix.flakeModule
./phpcs.nix
./phpstan.nix
];
perSystem =
{ config, ... }:
{
devshells.default.devshell.startup.git-hooks.text = config.pre-commit.installationScript;
};
}

7
nix/modules/phpcs.nix Normal file
View file

@ -0,0 +1,7 @@
{
perSystem.pre-commit.settings.hooks.phpcs = {
enable = true;
settings.binPath = "vendor/bin/phpcs";
};
}

7
nix/modules/phpstan.nix Normal file
View file

@ -0,0 +1,7 @@
{
perSystem.pre-commit.settings.hooks.phpstan = {
enable = true;
settings.binPath = "vendor/bin/phpstan";
};
}