diff --git a/modules/lang/nix/doctor.el b/modules/lang/nix/doctor.el index 043ce4c8c..fe1b18b35 100644 --- a/modules/lang/nix/doctor.el +++ b/modules/lang/nix/doctor.el @@ -4,8 +4,9 @@ (unless (executable-find "nix") (warn! "Couldn't find the nix package manager. nix-mode won't work.")) -(unless (executable-find "nixfmt") - (warn! "Couldn't find nixfmt. nix-format-buffer won't work.")) +(when (require 'nix-mode nil t) + (unless (executable-find nix-nixfmt-bin) + (warn! (concat "Couldn't find " nix-nixfmt-bin ". nix-format-buffer won't work.")))) (assert! (or (not (modulep! +tree-sitter)) (modulep! :tools tree-sitter))