From 6f5810bdb61d3c006fa95b54ff851f9388726d97 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Mon, 10 Nov 2025 23:26:53 +0100 Subject: [PATCH] Add nixf-diagnose --- README.md | 1 + modules/hooks.nix | 14 ++++++++++++++ nix/tools.nix | 2 ++ 3 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 3ead1501..9be42f88 100644 --- a/README.md +++ b/README.md @@ -387,6 +387,7 @@ use nix - [deadnix](https://github.com/astro/deadnix) - [flake-checker](https://github.com/DeterminateSystems/flake-checker) - [nil](https://github.com/oxalica/nil) +- [nixf-diagnose](https://github.com/inclyc/nixf-diagnose) - [nixfmt](https://github.com/NixOS/nixfmt/) (supports `nixfmt` >=v1.0) - [nixfmt-classic](https://github.com/NixOS/nixfmt/tree/v0.6.0) - [nixfmt-rfc-style](https://github.com/NixOS/nixfmt/) diff --git a/modules/hooks.nix b/modules/hooks.nix index 05f78c8d..e06eecdb 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -972,6 +972,12 @@ in imports = [ hookModule ]; }; }; + nixf-diagnose = mkOption { + description = "nixf-diagnose hook"; + type = types.submodule { + imports = [ hookModule ]; + }; + }; nixfmt = mkOption { description = "nixfmt hook"; type = types.submodule { @@ -3459,6 +3465,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm builtins.toString script; files = "\\.nix$"; }; + nixf-diagnose = + { + name = "nixf-diagnose"; + description = "wrapper for nixf-tidy."; + package = tools.nixf-diagnose; + entry = "${hooks.nixf-diagnose.package}/bin/nixf-diagnose"; + files = "\\.nix$"; + }; nixfmt = { name = "nixfmt"; diff --git a/nix/tools.nix b/nix/tools.nix index e64992ea..f4424830 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -52,6 +52,7 @@ , mdsh , nbstripout , nil +, nixf-diagnose , nixfmt , nixfmt-classic ? placeholder "nixfmt-classic" , nixfmt-rfc-style ? placeholder "nixfmt-rfc-style" @@ -159,6 +160,7 @@ in mdsh nbstripout nil + nixf-diagnose nixpkgs-fmt opam opentofu