added nixd lsp to helix

This commit is contained in:
Emile Clark-Boman 2025-02-13 12:23:39 +10:00
parent 1d4189b040
commit 64d5097f1a
4 changed files with 125 additions and 28 deletions

View file

@ -1,13 +1,10 @@
{
config,
pkgs,
...
}: {
{pkgs, ...}: {
# read https://docs.helix-editor.com/editor.html
programs.helix = {
enable = true;
settings = {
theme = "dracula";
editor = {
line-number = "absolute";
popup-border = "all";
@ -107,29 +104,41 @@
};
};
languages.language = [
{
name = "nix";
indent = {
tab-width = 2;
unit = " ";
languages = {
language = [
{
name = "nix";
indent = {
tab-width = 2;
unit = " ";
};
block-comment-tokens = {
start = "/*";
end = "*/";
};
auto-format = true;
formatter.command = "${pkgs.alejandra}/bin/alejandra";
language-servers = ["nixd"];
}
{
name = "python";
indent = {
tab-width = 4;
unit = " ";
};
auto-format = false; # my python is beautiful ^_^
rulers = [80];
}
];
language-server = {
# use nixd as default nix lsp (I haven't tried nil yet)
# NOTE: nixd will be supported by default after nix 24.07
# SOURCE: https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md#Helix
nixd = {
command = "${pkgs.nixd}/bin/nixd";
};
block-comment-tokens = {
start = "/*";
end = "*/";
};
auto-format = true;
formatter.command = "${pkgs.alejandra}/bin/alejandra";
}
{
name = "python";
indent = {
tab-width = 4;
unit = " ";
};
auto-format = false; # my python is beautiful ^_^
rulers = [80];
}
];
};
};
};
}