mirror of
https://git.sr.ht/~neverness/ultima
synced 2025-01-10 12:53:58 +00:00
129 lines
3.8 KiB
Nix
129 lines
3.8 KiB
Nix
{ pkgs, ... }:
|
|
let
|
|
indent = {
|
|
tab-width = 2;
|
|
unit = " ";
|
|
};
|
|
auto-format = true;
|
|
in {
|
|
programs.helix = with pkgs; {
|
|
languages = {
|
|
language = let prettier = nodePackages_latest.prettier;
|
|
in [
|
|
{ # NIX LSP
|
|
name = "nix";
|
|
language-servers = [ "nixd" ];
|
|
formatter.command = "${nixfmt-classic}/bin/nixfmt";
|
|
indent = indent;
|
|
inherit auto-format;
|
|
}
|
|
{ # HTML
|
|
name = "html";
|
|
language-servers = [ "vscode-html" ];
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${prettier}/bin/prettier";
|
|
args = [ "--use-tabs" "--parser" "html" ];
|
|
};
|
|
}
|
|
{ # JSON
|
|
name = "json";
|
|
language-servers = [ "vscode-json" ];
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${prettier}/bin/prettier";
|
|
args = [ "--use-tabs" "--parser" "json" ];
|
|
};
|
|
}
|
|
{ # JSON
|
|
name = "jsonc";
|
|
language-servers = [ "vscode-json" ];
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${prettier}/bin/prettier";
|
|
args = [ "--use-tabs" "--parser" "json" ];
|
|
};
|
|
}
|
|
{ # CSS
|
|
name = "css";
|
|
language-servers = [ "vscode-css" ];
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${prettier}/bin/prettier";
|
|
args = [ "--use-tabs" "--parser" "css" ];
|
|
};
|
|
}
|
|
{ # MARKDOWN
|
|
name = "markdown";
|
|
language-servers = [ "marksman" ];
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${prettier}/bin/prettier";
|
|
args = [ "--use-tabs" "--parser" "markdown" ];
|
|
};
|
|
}
|
|
{ # TYPESCRIPT
|
|
name = "typescript";
|
|
language-servers = [ "typescript" ];
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${prettier}/bin/prettier";
|
|
args = [ "--use-tabs" "--parser" "typescript" ];
|
|
};
|
|
}
|
|
{ # PYTHON
|
|
name = "python";
|
|
language-servers = [ "pylsp" "ruff" ];
|
|
shebangs = [ "${python39}/bin/python" ];
|
|
file-types = [ "py" "pyi" "py3" "pyw" ".pythonstartup" ".pythonrc" ];
|
|
roots = [ "." "pyproject.toml" "pyrightconfig.json" ];
|
|
comment-token = "#";
|
|
scope = "source.python";
|
|
injection-regex = "python";
|
|
indent = indent;
|
|
inherit auto-format;
|
|
formatter = {
|
|
command = "${ruff}/bin/ruff";
|
|
args = [ "format" "-" ];
|
|
};
|
|
}
|
|
];
|
|
language-server = let
|
|
vscode = vscode-langservers-extracted;
|
|
typescript = typescript-language-server;
|
|
in {
|
|
nixd.command = "${nixd}/bin/nixd";
|
|
vscode-html.command = "${vscode}/bin/vscode-html-language-server";
|
|
vscode-json.command = "${vscode}/bin/vscode-json-language-server";
|
|
vscode-css.command = "${vscode}/bin/vscode-css-language-server";
|
|
marksman.command = "${marksman}/bin/marksman";
|
|
typescript.command = "${typescript}/bin/typescript-language-server";
|
|
pyright = {
|
|
command = "${pyright}/bin/pyright-langserver";
|
|
args = [ "--stdio" ];
|
|
config = {
|
|
reportMissingTypeStubs = false;
|
|
python.analysis = {
|
|
typeCheckingMode = "basic";
|
|
autoImportCompletions = true;
|
|
};
|
|
};
|
|
};
|
|
ruff.command = "${ruff-lsp}/bin/ruff-lsp";
|
|
};
|
|
};
|
|
extraPackages = with pkgs; [
|
|
# OTHER LSP
|
|
yaml-language-server
|
|
lua-language-server
|
|
taplo
|
|
];
|
|
};
|
|
}
|