From e1e6c39bf17f10b8290b7a9346ed3dd8564c1652 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 8 Mar 2023 17:59:15 +0000 Subject: [PATCH] flake: checks: convert to 'flake-parts' --- flake/checks.nix | 24 ++++++++++++++---------- flake/default.nix | 3 +-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/flake/checks.nix b/flake/checks.nix index ea77620..50f20b1 100644 --- a/flake/checks.nix +++ b/flake/checks.nix @@ -1,16 +1,20 @@ -{ self, pre-commit-hooks, ... }: -system: +{ self, inputs, ... }: { - pre-commit = pre-commit-hooks.lib.${system}.run { - src = self; + perSystem = { system, ... }: { + checks = { + # NOTE: seems like inputs' does not output the 'lib' attribute + pre-commit = inputs.pre-commit-hooks.lib.${system}.run { + src = self; - hooks = { - nixpkgs-fmt = { - enable = true; - }; + hooks = { + nixpkgs-fmt = { + enable = true; + }; - shellcheck = { - enable = true; + shellcheck = { + enable = true; + }; + }; }; }; }; diff --git a/flake/default.nix b/flake/default.nix index c73378f..3ba2b19 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -26,8 +26,6 @@ let default = self.apps.${system}.diff-flake; }; - checks = import ./checks.nix inputs system; - devShells = import ./dev-shells.nix inputs system; packages = import ./packages.nix inputs system; @@ -74,6 +72,7 @@ flake-parts.lib.mkFlake { inherit inputs; } { systems = mySystems; imports = [ + ./checks.nix ./lib.nix ./nixos.nix ./overlays.nix