Merge pull request #604 from nezia1/add-nixd
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (push) Waiting to run
Validate flake & check documentation / Validate hyperlinks in documentation sources (push) Waiting to run
Validate flake & check formatting / Validate Flake (push) Waiting to run
Validate flake & check formatting / Formatting via Alejandra (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Check for typos in the source tree / check-typos (push) Waiting to run

languages/nix: add nixd
This commit is contained in:
raf 2025-02-06 16:45:30 +00:00 committed by GitHub
commit ff31e0fe25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 0 deletions

View file

@ -139,3 +139,7 @@
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
Inspiration from `vim.languages.clang.dap` implementation.
[nezia1](https://github.com/nezia1)
- Add support for [nixd](https://github.com/nix-community/nixd) language server.

View file

@ -59,6 +59,40 @@
}
'';
};
nixd = {
package = pkgs.nixd;
internalFormatter = true;
lspConfig = ''
lspconfig.nixd.setup{
capabilities = capabilities,
${
if cfg.format.enable
then useFormat
else noFormat
},
cmd = ${packageToCmd cfg.lsp.package "nixd"},
${optionalString cfg.format.enable ''
settings = {
nixd = {
${optionalString (cfg.format.type == "alejandra")
''
formatting = {
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
},
''}
${optionalString (cfg.format.type == "nixfmt")
''
formatting = {
command = {"${cfg.format.package}/bin/nixfmt"},
},
''}
},
},
''}
}
'';
};
};
defaultFormat = "alejandra";