Add pre-commit fmt hook
All checks were successful
CI / build (push) Successful in 1m55s

This commit is contained in:
Fabian Hauser 2025-03-04 14:40:29 +02:00
parent 78629de651
commit 9a05c65763
3 changed files with 79 additions and 2 deletions

View file

@ -17,6 +17,10 @@
flake-parts.follows = "flake-parts";
};
};
git-hooks-nix = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
@ -60,12 +64,14 @@
imports = map (name: inputs.${name}.flakeModule) [
"treefmt-nix"
"ez-configs"
"git-hooks-nix"
];
systems = [
"x86_64-linux"
];
perSystem =
{
config,
pkgs,
lib,
self',
@ -82,6 +88,13 @@
};
settings.global.excludes = [ "*.jpg" ];
};
pre-commit = {
check.enable = false;
settings.hooks.treefmt = {
enable = true;
always_run = true;
};
};
checks =
with lib;
@ -107,6 +120,9 @@
nixd
;
};
shellHook = ''
${config.pre-commit.installationScript}
'';
};
};