From f836518bf06d80f58ca8fc3519010b1c46f042a5 Mon Sep 17 00:00:00 2001 From: Silas Schöffel Date: Sun, 7 Apr 2024 19:05:14 +0200 Subject: treewide: enable pre-commit hooks --- flake.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index d2cc2bf..f070713 100644 --- a/flake.nix +++ b/flake.nix @@ -174,6 +174,7 @@ flake-utils, agenix, ragenix, + git-hooks, ... } @ attrs: flake-utils.lib.eachDefaultSystem (system: let @@ -188,8 +189,11 @@ plugins.airline.settings.theme = "minimalist"; }; nvim = nixvim.legacyPackages."${system}".makeNixvim nixVimConfig; + hooks = self.checks.${system}.pre-commit; in { devShells.default = pkgs.mkShell { + inherit (hooks) shellHook; + buildInputs = hooks.enabledPackages; packages = with pkgs; [ nil statix @@ -210,6 +214,12 @@ inherit nvim; name = "My NixVim Configuration"; }; + pre-commit = git-hooks.lib.${system}.run { + src = ./.; + hooks = { + alejandra.enable = true; + }; + }; }; }) // { -- cgit 1.4.1