diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index b677ae98..95b37b79 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -486,3 +486,5 @@ - Add [roslyn-ls] to the `vim.languages.csharp` module. - Added json support under `vim.languages.json` using [jsonls] and [jsonfmt]. + +- Add flake formatter type to the nix language module. diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index 6127f78e..ea1c6d00 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -23,6 +23,9 @@ (mkIf (cfg.format.type == "nixfmt") { command = ["${cfg.format.package}/bin/nixfmt"]; }) + (mkIf (cfg.format.type == "flake") { + command = ["${cfg.format.package}/bin/nix" "fmt"]; + }) ]; }; @@ -58,6 +61,10 @@ nixfmt = { package = pkgs.nixfmt-rfc-style; }; + + flake = { + package = pkgs.nix; + }; }; defaultDiagnosticsProvider = ["statix" "deadnix"];