1
1
mirror of https://github.com/oxalica/nil.git synced 2024-11-21 15:56:00 +03:00

Update docs examples to use nixfmt-rfc-style

This is now the chosen formatter for nixpkgs.
This commit is contained in:
oxalica 2024-09-18 23:06:38 -04:00
parent 555d517d46
commit 9125bfeaff
5 changed files with 7 additions and 7 deletions

View File

@ -70,7 +70,7 @@ Merge this setting into your `coc-settings.json` (open with `:CocConfig`).
// Uncomment these to tweak settings.
// "settings": {
// "nil": {
// "formatting": { "command": ["nixpkgs-fmt"] }
// "formatting": { "command": ["nixfmt"] }
// }
// }
}
@ -108,7 +108,7 @@ Add the following elisp code to your configuration. (using `use-package`)
:after (lsp-mode)
:demand t
:custom
(lsp-nix-nil-formatter ["nixpkgs-fmt"]))
(lsp-nix-nil-formatter ["nixfmt"]))
(use-package nix-mode
:hook (nix-mode . lsp-deferred)
@ -144,7 +144,7 @@ Modify the extension's settings in your `settings.json`.
// Uncomment these to tweak settings.
// "nix.serverSettings": {
// "nil": {
// "formatting": { "command": ["nixpkgs-fmt"] }
// "formatting": { "command": ["nixfmt"] }
// }
// }
}

View File

@ -88,7 +88,7 @@ let
['nil'] = {
testSetting = 42,
formatting = {
command = { "nixpkgs-fmt" },
command = { "nixfmt" },
},
},
},

View File

@ -97,7 +97,7 @@ let
nil.server.path = pkgs.writeShellScript "nil" ''
exec "$NIL_PATH" "$@"
'';
nil.formatting.command = [ "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" ];
nil.formatting.command = [ (pkgs.lib.getExe pkgs.nixfmt-rfc-style) ];
nil.diagnostics.excludedFiles = [ "generated.nix" ];
nil.nix.flake.autoEvalInputs = true;
nil.nix.maxMemoryMB = 2048;

View File

@ -23,7 +23,7 @@ Default configuration:
// External formatter command (with arguments).
// It should accepts file content in stdin and print the formatted code into stdout.
// Type: [string] | null
// Example: ["nixpkgs-fmt"]
// Example: ["nixfmt"]
"command": null,
},
"diagnostics": {

View File

@ -116,7 +116,7 @@ rec {
jq
pre-commit
nixpkgs-fmt
nixfmt-rfc-style
(import ./dev/nvim-lsp.nix { inherit pkgs; })
(import ./dev/vim-coc.nix { inherit pkgs; })
(import ./dev/vim-lsp.nix { inherit pkgs; })