From 03af560441c5f9d979dce33f67c6e5a39b6fdfe2 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 18 Sep 2022 11:50:32 -0700 Subject: ref(flake): move all the checks to external module This improve the readability of the flake configuration, the check can be in their own module. --- nix/checks.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 nix/checks.nix (limited to 'nix/checks.nix') diff --git a/nix/checks.nix b/nix/checks.nix new file mode 100644 index 0000000..aadb170 --- /dev/null +++ b/nix/checks.nix @@ -0,0 +1,31 @@ +{ pkgs, pre-commit-hooks, ... }: + +with pkgs; + +{ + pre-commit-check = pre-commit-hooks.lib.${system}.run { + src = lib.cleanSource ../.; + hooks = { + nix-linter.enable = true; + nixpkgs-fmt.enable = true; + trailing-whitespace = { + enable = true; + entry = + "${pkgs.python3Packages.pre-commit-hooks}/bin/trailing-whitespace-fixer"; + types = [ "text" ]; + }; + end-of-file-fixer = { + enable = true; + entry = + "${pkgs.python3Packages.pre-commit-hooks}/bin/end-of-file-fixer"; + types = [ "text" ]; + }; + terraform-format = { enable = true; }; + shellcheck = { + enable = true; + files = "\\.sh$"; + types_or = [ "file" ]; + }; + }; + }; +} -- cgit 1.4.1