feat: add pre-commit hooks

This commit is contained in:
Moritz Böhme 2025-04-13 17:19:30 +02:00
parent 960d0244bc
commit fa98060dcf
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
3 changed files with 108 additions and 21 deletions

View file

@ -8,11 +8,11 @@
# New flake-parts input
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
clan-core = {
url = "git+https://git.clan.lol/clan/clan-core";
inputs.nixpkgs.follows = "nixpkgs"; # Needed if your configuration uses nixpkgs unstable.
# New
inputs.flake-parts.follows = "flake-parts";
};
@ -66,11 +66,21 @@
# import clan-core modules
imports = [
inputs.clan-core.flakeModules.default
inputs.git-hooks-nix.flakeModule
];
perSystem = { config, inputs', pkgs, ... }: {
devShells.default = pkgs.mkShell {
packages = [ inputs'.clan-core.packages.clan-cli ];
packages = [ inputs'.clan-core.packages.clan-cli pkgs.alejandra ];
};
pre-commit.settings.hooks = {
alejandra.enable = true;
check-merge-conflicts.enable = true;
flake-checker.enable = true;
deadnix.enable = true;
nil.enable = true;
statix.enable = true;
};
};