Added git hooks

This commit is contained in:
Jurn Wubben 2025-05-24 14:34:52 +02:00
parent 3360f30690
commit 47215b5690
3 changed files with 82 additions and 6 deletions

View file

@ -5,6 +5,7 @@
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
imports = [
inputs.git-hooks-nix.flakeModule
./hosts
];
@ -13,6 +14,13 @@
pkgs,
...
}: {
pre-commit.settings.hooks = {
alejandra.enable = true;
flake-checker.enable = true;
nil.enable = true;
};
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
packages = [
pkgs.alejandra
@ -20,9 +28,11 @@
];
name = "dots";
DIRENV_LOG_FORMAT = "";
};
formatter = pkgs.alejandra;
shellHook = ''
${config.pre-commit.installationScript}
'';
};
};
};
@ -31,6 +41,10 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # build error unrelated to config.
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11-small"; # build error unrelated to config.
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks-nix = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
hm = {
url = "github:nix-community/home-manager/master";