From 5f8e62f8bf4ea06e9fcc02b9daff235a2e7d6f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Mon, 8 Aug 2022 23:53:33 +0200 Subject: [PATCH] feat(flake): add pre-commit to checks --- flake.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 775c6ce..91d5e60 100644 --- a/flake.nix +++ b/flake.nix @@ -182,22 +182,12 @@ }; }; - checks = builtins.mapAttrs - (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; - } // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; - pre-commit-check = pre-commit-hooks.lib.${system}.run { - src = ./.; - hooks = { - nixfmt.enable = true; - shellcheck.enable = true; - }; - }; in rec { formatter = pkgs.nixfmt; @@ -206,6 +196,16 @@ apps = { deconz = flake-utils.lib.mkApp { drv = packages.deconz; }; }; devShells.default = - pkgs.mkShell { inherit (pre-commit-check) shellHook; }; + pkgs.mkShell { inherit (checks.pre-commit) shellHook; }; + + checks = deploy-rs.lib.${system}.deployChecks self.deploy // { + pre-commit = pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + nixfmt.enable = true; + shellcheck.enable = true; + }; + }; + }; }); }