languages/nix: make nix fmt work outside the lsp

Add a writeShellApplication wrapper to allow the flake formatter to
stand on it's own.
This commit is contained in:
Cool-Game-Dev 2025-08-13 16:43:21 -05:00
commit f48e872f93
No known key found for this signature in database

View file

@ -24,7 +24,7 @@
command = ["${cfg.format.package}/bin/nixfmt"]; command = ["${cfg.format.package}/bin/nixfmt"];
}) })
(mkIf (cfg.format.type == "flake") { (mkIf (cfg.format.type == "flake") {
command = ["${cfg.format.package}/bin/nix" "fmt"]; command = ["${cfg.format.package}/bin/nix_fmt"];
}) })
]; ];
}; };
@ -63,7 +63,11 @@
}; };
flake = { flake = {
package = pkgs.nix; package = pkgs.writeShellApplication {
name = "nix_fmt";
runtimeInputs = [pkgs.nix];
text = "nix fmt";
};
}; };
}; };