diff options
| author | Franck Cuny <franck@fcuny.net> | 2022-09-18 11:50:32 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2022-09-18 11:50:32 -0700 |
| commit | 03af560441c5f9d979dce33f67c6e5a39b6fdfe2 (patch) | |
| tree | 709cdc1d479f85c58e2d1175ea628fd3987e7c63 /flake.nix | |
| parent | ref(flake): drop naersk for now (diff) | |
| download | infra-03af560441c5f9d979dce33f67c6e5a39b6fdfe2.tar.gz | |
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.
Diffstat (limited to '')
| -rw-r--r-- | flake.nix | 36 |
1 files changed, 3 insertions, 33 deletions
@@ -43,7 +43,7 @@ }; # Output config, or config for NixOS system - outputs = { self, ... }@inputs: + outputs = { self, pre-commit-hooks, ... }@inputs: let inherit (inputs.futils.lib) eachSystem system; mySystems = [ system.x86_64-linux ]; @@ -65,37 +65,7 @@ users.fcuny = import ./users/fcuny { inherit pkgs; }; }; - checks = { - pre-commit = inputs.pre-commit-hooks.lib.${system}.run { - src = ./.; - - hooks = { - 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" ]; - }; - - nixpkgs-fmt = { enable = true; }; - - terraform-format = { enable = true; }; - - shellcheck = { - enable = true; - files = "\\.sh$"; - types_or = [ "file" ]; - }; - }; - }; - }; + checks = import ./nix/checks.nix { inherit pkgs pre-commit-hooks; }; devShells = { default = pkgs.mkShell { @@ -111,7 +81,7 @@ go gopls ]; - inherit (self.checks.${system}.pre-commit) shellHook; + inherit (self.checks.${system}.pre-commit-check) shellHook; }; }; }) // { |
