From 5a2c855381ddd9c520c27808469cb0f9057a8ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 1 Oct 2023 22:51:53 +0300 Subject: [PATCH] enable some checks in pre-commit hooks --- .gitignore | 3 +++ flake.nix | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index acf271d..5f7ae2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /result /.direnv + +# nix managed +/.pre-commit-config.yaml diff --git a/flake.nix b/flake.nix index a0a7849..935e3ca 100644 --- a/flake.nix +++ b/flake.nix @@ -225,19 +225,21 @@ }; checks = - (builtins.mapAttrs (_system: deployLib: - deployLib.deployChecks self.deploy) - deploy-rs.lib) - // { - x86_64-linux.pre-commit-check = inputs.pre-commit-hooks.lib.x86_64-linux.run { - src = ./.; - hooks = { - alejandra.enable = true; - deadnix.enable = true; - #statix.enable = true; - }; - }; - }; + builtins.mapAttrs ( + system: deployLib: + deployLib.deployChecks self.deploy + // { + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + alejandra.enable = true; + deadnix.enable = true; + #statix.enable = true; + }; + }; + } + ) + deploy-rs.lib; } // flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs {inherit system;}; @@ -251,7 +253,7 @@ agenix.packages.${system}.agenix ]; - inherit (inputs.self.checks.x86_64-linux.pre-commit-check) shellHook; + inherit (inputs.self.checks.${system}.pre-commit-check) shellHook; }; formatter = pkgs.alejandra;