feat: add pre-commit hooks
This commit is contained in:
parent
960d0244bc
commit
fa98060dcf
3 changed files with 108 additions and 21 deletions
14
flake.nix
14
flake.nix
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue