From c4e3cd4ca89d60be6c6e9b7338e9e3442266000b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Reynier?= Date: Thu, 18 Apr 2024 17:05:58 +0000 Subject: [PATCH 1/2] Add Flake Checker --- README.md | 1 + modules/hooks.nix | 8 ++++++++ nix/tools.nix | 2 ++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 86f5e5a3..63bdbab7 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ use nix - [alejandra](https://github.com/kamadorueda/alejandra) - [deadnix](https://github.com/astro/deadnix) +- [flake-checker](https://github.com/DeterminateSystems/flake-checker) - [nil](https://github.com/oxalica/nil) - [nixfmt](https://github.com/serokell/nixfmt/) - [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) diff --git a/modules/hooks.nix b/modules/hooks.nix index 9e64c0f0..564afda3 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2239,6 +2239,14 @@ in "${binPath} --format ${hooks.flake8.settings.format} ${extendIgnoreStr}"; types = [ "python" ]; }; + flake-checker = { + name = "flake-checker"; + description = "Run health on the Nix flake."; + package = tools.flake-checker; + entry = "${hooks.flake-checker.package}/bin/flake-checker -f"; + files = "(^flake\\.nix$|^flake\\.lock$)"; + pass_filenames = false; + }; flynt = { name = "flynt"; diff --git a/nix/tools.nix b/nix/tools.nix index c40c14b2..bb9549f4 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -26,6 +26,7 @@ , editorconfig-checker , elixir , elmPackages +, flake-checker ? null , fprettify , git-annex , gptcommit ? null @@ -108,6 +109,7 @@ in eclint editorconfig-checker elixir + flake-checker fprettify go go-tools From f0dcdc1b204360250028d6496e265a73049b0e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Reynier?= <88983487+loicreynier@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:27:13 +0200 Subject: [PATCH 2/2] Update modules/hooks.nix Co-authored-by: sander --- modules/hooks.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hooks.nix b/modules/hooks.nix index 564afda3..702fea72 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2241,7 +2241,7 @@ in }; flake-checker = { name = "flake-checker"; - description = "Run health on the Nix flake."; + description = "Run health checks on your flake-powered Nix projects."; package = tools.flake-checker; entry = "${hooks.flake-checker.package}/bin/flake-checker -f"; files = "(^flake\\.nix$|^flake\\.lock$)";