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 fi
use flake use flake
watch_file ./flake/checks.nix
eval "$shellHooks" eval "$shellHooks"

View file

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