languages/nix: add nixd to supported LSP servers

Add nixd to flake.nix and legacyPackages.nix.

Format with alejandra.

Update flake.nix

Undo change made by nixfmt-rfc-style

Set nixd to follow flake-utils as well.

Update nixd lspConfig
This commit is contained in:
Elias Ainsworth 2024-11-10 21:47:58 -07:00
commit bcab9c277c
4 changed files with 130 additions and 3 deletions

View file

@ -74,6 +74,23 @@
}
'';
};
nixd = {
package = pkgs.nixd;
internalFormatter = cfg.format.type == "nixpkgs-fmt";
lspConfig = ''
lspconfig.nixd.setup{
capabilities = capabilities,
on_attach = default_on_attach,
${
if (cfg.format.enable && cfg.format.type == "nixpkgs-fmt")
then useFormat
else noFormat
},
cmd = ${packageToCmd cfg.lsp.package "nixd"},
}
'';
};
};
defaultFormat = "alejandra";