flake: move 'checks' to 'flake/'

This commit is contained in:
Bruno BELANYI 2023-03-07 10:49:12 +00:00
parent 90d1d81983
commit fc02519c4f
3 changed files with 21 additions and 15 deletions

3
.envrc
View File

@ -3,4 +3,7 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
fi
use flake
watch_file ./flake/checks.nix
eval "$shellHooks"

View File

@ -120,21 +120,7 @@
default = apps.diff-flake;
};
checks = {
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt = {
enable = true;
};
shellcheck = {
enable = true;
};
};
};
};
checks = import ./flake/checks.nix inputs system;
devShells = {
default = pkgs.mkShell {

17
flake/checks.nix Normal file
View File

@ -0,0 +1,17 @@
{ self, pre-commit-hooks, ... }:
system:
{
pre-commit = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
nixpkgs-fmt = {
enable = true;
};
shellcheck = {
enable = true;
};
};
};
}