mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-05 18:01:32 +00:00
languages/nix: Add flake formatter
Add a formatter to the nix language module that runs the `nix fmt` command, which uses a flakes default formatter.
This commit is contained in:
parent
f578f82b4d
commit
0e5db64202
2 changed files with 9 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue