2026-01-29 14:39:59 +10:00
|
|
|
|
{
|
|
|
|
|
|
pkgs,
|
|
|
|
|
|
pkgs-unstable,
|
|
|
|
|
|
...
|
|
|
|
|
|
}: let
|
2026-01-31 08:36:10 +10:00
|
|
|
|
lsps = {
|
2026-01-31 10:57:59 +10:00
|
|
|
|
bash-language-server = {
|
|
|
|
|
|
pkg = pkgs.bash-language-server;
|
|
|
|
|
|
cmd = "bash-language-server";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|
2026-01-31 10:57:59 +10:00
|
|
|
|
clangd = {
|
|
|
|
|
|
pkg = pkgs.clang-tools;
|
|
|
|
|
|
cmd = "clangd";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|
2026-01-31 11:07:09 +10:00
|
|
|
|
glsl_analyzer = {
|
|
|
|
|
|
pkg = pkgs.glsl_analyzer;
|
|
|
|
|
|
cmd = "glsl_analyzer";
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-01-31 10:57:59 +10:00
|
|
|
|
haskell-language-server = {
|
|
|
|
|
|
pkg = pkgs.haskell-language-server;
|
|
|
|
|
|
cmd = "haskell-language-server-wrapper";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|
|
|
|
|
|
# TODO: once upgraded past Nix-24.07 this line won't be necessary (I think)
|
|
|
|
|
|
# helix will support nixd by default
|
|
|
|
|
|
# SOURCE: https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md#Helix
|
2026-01-31 10:57:59 +10:00
|
|
|
|
nixd = {
|
|
|
|
|
|
pkg = pkgs.nixd;
|
|
|
|
|
|
cmd = "nixd";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|
2026-01-31 10:57:59 +10:00
|
|
|
|
OmniSharp = {
|
|
|
|
|
|
pkg = pkgs.omnisharp-roslyn;
|
|
|
|
|
|
cmd = "OmniSharp";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|
2026-01-31 10:57:59 +10:00
|
|
|
|
rust-analyzer = {
|
|
|
|
|
|
pkg = pkgs.rust-analyzer;
|
|
|
|
|
|
cmd = "rust-analyzer";
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ty = {
|
|
|
|
|
|
pkg = pkgs-unstable.ty;
|
|
|
|
|
|
cmd = "ty";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|
2026-01-31 10:57:59 +10:00
|
|
|
|
typescript-language-server = {
|
|
|
|
|
|
pkg = pkgs.typescript-language-server;
|
|
|
|
|
|
cmd = "typescript-language-server";
|
|
|
|
|
|
};
|
2026-01-29 14:39:59 +10:00
|
|
|
|
};
|
|
|
|
|
|
in {
|
2026-01-31 08:36:10 +10:00
|
|
|
|
home.packages =
|
2026-01-29 14:39:59 +10:00
|
|
|
|
lsps
|
2026-01-31 08:36:10 +10:00
|
|
|
|
|> builtins.attrValues
|
2026-01-29 14:39:59 +10:00
|
|
|
|
|> map (lsp: lsp.pkg);
|
|
|
|
|
|
|
|
|
|
|
|
# REF: https://docs.helix-editor.com/editor.html
|
2024-11-10 23:10:51 +10:00
|
|
|
|
programs.helix = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
settings = {
|
|
|
|
|
|
theme = "dracula";
|
2025-02-13 12:23:39 +10:00
|
|
|
|
|
2024-11-10 23:10:51 +10:00
|
|
|
|
editor = {
|
|
|
|
|
|
line-number = "absolute";
|
|
|
|
|
|
popup-border = "all";
|
|
|
|
|
|
scroll-lines = 3;
|
|
|
|
|
|
color-modes = true; # colour the mode indicator depending on mode
|
|
|
|
|
|
shell = ["zsh" "-c"];
|
|
|
|
|
|
|
|
|
|
|
|
auto-format = true;
|
|
|
|
|
|
auto-completion = true; # enable popup for autocomplete
|
|
|
|
|
|
completion-timeout = 250; # time before completions display
|
|
|
|
|
|
preview-completion-insert = true;
|
|
|
|
|
|
completion-trigger-len = 2; # min word length to trigger completions
|
|
|
|
|
|
completion-replace = true; # completions replace entire word
|
|
|
|
|
|
|
|
|
|
|
|
indent-heuristic = "tree-sitter"; # how indentation is computed
|
|
|
|
|
|
# TODO: make this configurable (enabled on myputer, disabled on lolcathost)
|
|
|
|
|
|
middle-click-paste = true;
|
|
|
|
|
|
insert-final-newline = true; # append newline to file on write
|
|
|
|
|
|
|
|
|
|
|
|
gutters = [
|
|
|
|
|
|
"diagnostics"
|
|
|
|
|
|
"spacer"
|
|
|
|
|
|
"line-numbers"
|
|
|
|
|
|
"spacer"
|
|
|
|
|
|
"diff"
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
whitespace = {
|
|
|
|
|
|
render = {
|
|
|
|
|
|
space = "none"; # "all"
|
|
|
|
|
|
tab = "none"; #"all"
|
|
|
|
|
|
nbsp = "none";
|
|
|
|
|
|
nnbsp = "none";
|
|
|
|
|
|
newline = "none";
|
|
|
|
|
|
};
|
|
|
|
|
|
characters = {
|
|
|
|
|
|
space = "·";
|
|
|
|
|
|
nbsp = "⍽";
|
|
|
|
|
|
nnbsp = "␣";
|
|
|
|
|
|
tab = "→";
|
|
|
|
|
|
newline = "⤶";
|
|
|
|
|
|
tabpad = "·"; # Tabs will look like "→···" (depending on tab width)
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
indent-guides = {
|
|
|
|
|
|
render = true;
|
|
|
|
|
|
character = "▏"; # "|"
|
|
|
|
|
|
skip-levels = 1;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
lsp = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
auto-signature-help = true; # hints for function parameters
|
|
|
|
|
|
display-inlay-hints = true; # inline hints
|
|
|
|
|
|
snippets = true;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
cursor-shape = {
|
|
|
|
|
|
normal = "block";
|
|
|
|
|
|
insert = "bar";
|
|
|
|
|
|
select = "block";
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
file-picker = {
|
|
|
|
|
|
hidden = true; # show hidden files
|
|
|
|
|
|
follow-symlinks = true;
|
|
|
|
|
|
deduplicate-links = true;
|
|
|
|
|
|
git-ignore = false; # dont read .gitignore files
|
|
|
|
|
|
ignore = true; # use .ignore for helix instead of .gitignore
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
statusline = {
|
|
|
|
|
|
left = [
|
|
|
|
|
|
"mode"
|
|
|
|
|
|
"spacer"
|
|
|
|
|
|
"version-control"
|
|
|
|
|
|
"spinner"
|
|
|
|
|
|
];
|
|
|
|
|
|
center = [
|
|
|
|
|
|
"file-name"
|
|
|
|
|
|
"read-only-indicator"
|
|
|
|
|
|
"file-modification-indicator"
|
|
|
|
|
|
];
|
|
|
|
|
|
right = [
|
|
|
|
|
|
"position"
|
|
|
|
|
|
"total-line-numbers"
|
|
|
|
|
|
"file-encoding"
|
|
|
|
|
|
"file-line-ending"
|
|
|
|
|
|
"file-type"
|
|
|
|
|
|
];
|
|
|
|
|
|
separator = "|";
|
|
|
|
|
|
mode.normal = "NORMAL";
|
|
|
|
|
|
mode.insert = "INSERT";
|
|
|
|
|
|
mode.select = "SELECT";
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-02-13 12:23:39 +10:00
|
|
|
|
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];
|
2026-01-29 14:39:59 +10:00
|
|
|
|
language-servers = ["ty"];
|
2025-02-13 12:23:39 +10:00
|
|
|
|
}
|
2025-07-01 14:55:10 +10:00
|
|
|
|
{
|
|
|
|
|
|
name = "c";
|
2025-08-31 15:05:02 +10:00
|
|
|
|
file-types = ["c" "h"]; # use .hpp for C++
|
2026-01-29 14:39:59 +10:00
|
|
|
|
auto-format = true;
|
2025-07-01 14:55:10 +10:00
|
|
|
|
formatter.command = "${pkgs.clang-tools}/bin/clang-format";
|
|
|
|
|
|
language-servers = ["clangd"];
|
|
|
|
|
|
}
|
2025-09-03 00:37:55 +10:00
|
|
|
|
{
|
|
|
|
|
|
name = "haskell";
|
|
|
|
|
|
auto-format = true;
|
|
|
|
|
|
formatter.command = "${pkgs.ormolu}/bin/ormolu";
|
|
|
|
|
|
language-servers = ["haskell-language-server"];
|
|
|
|
|
|
}
|
2026-01-20 09:18:27 +10:00
|
|
|
|
{
|
|
|
|
|
|
name = "rust";
|
|
|
|
|
|
indent = {
|
|
|
|
|
|
tab-width = 2;
|
|
|
|
|
|
unit = " ";
|
|
|
|
|
|
};
|
|
|
|
|
|
auto-format = true;
|
|
|
|
|
|
formatter.command = "${pkgs.rustfmt}/bin/rustfmt";
|
|
|
|
|
|
language-servers = ["rust-analyzer"];
|
|
|
|
|
|
}
|
2026-01-29 14:39:59 +10:00
|
|
|
|
{
|
|
|
|
|
|
name = "c-sharp";
|
|
|
|
|
|
file-types = ["cs"];
|
|
|
|
|
|
indent = {
|
|
|
|
|
|
tab-width = 4;
|
|
|
|
|
|
unit = " ";
|
|
|
|
|
|
};
|
|
|
|
|
|
block-comment-tokens = {
|
|
|
|
|
|
start = "/*";
|
|
|
|
|
|
end = "*/";
|
|
|
|
|
|
};
|
2026-01-31 11:07:09 +10:00
|
|
|
|
# auto-format = true;
|
2026-01-29 14:39:59 +10:00
|
|
|
|
# formatter.command = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
|
|
|
|
|
|
# language-servers = ["OmniSharp"];
|
|
|
|
|
|
}
|
2026-01-31 10:57:59 +10:00
|
|
|
|
{
|
|
|
|
|
|
name = "javascript";
|
|
|
|
|
|
file-types = ["js"];
|
|
|
|
|
|
indent = {
|
|
|
|
|
|
tab-width = 2;
|
|
|
|
|
|
unit = " ";
|
|
|
|
|
|
};
|
|
|
|
|
|
block-comment-tokens = {
|
|
|
|
|
|
start = "/*";
|
|
|
|
|
|
end = "*/";
|
|
|
|
|
|
};
|
|
|
|
|
|
auto-format = true;
|
|
|
|
|
|
language-servers = ["typescript-language-server"];
|
|
|
|
|
|
}
|
2026-01-31 11:07:09 +10:00
|
|
|
|
{
|
|
|
|
|
|
name = "glsl";
|
|
|
|
|
|
file-types = ["glsl"];
|
|
|
|
|
|
indent = {
|
|
|
|
|
|
tab-width = 2;
|
|
|
|
|
|
unit = " ";
|
|
|
|
|
|
};
|
|
|
|
|
|
block-comment-tokens = {
|
|
|
|
|
|
start = "/*";
|
|
|
|
|
|
end = "*/";
|
|
|
|
|
|
};
|
|
|
|
|
|
auto-format = false;
|
|
|
|
|
|
language-servers = ["glsl_analyzer"];
|
|
|
|
|
|
}
|
2025-02-13 12:23:39 +10:00
|
|
|
|
];
|
|
|
|
|
|
|
2026-01-29 14:39:59 +10:00
|
|
|
|
language-server =
|
|
|
|
|
|
lsps
|
2026-01-31 10:57:59 +10:00
|
|
|
|
|> builtins.mapAttrs (_: lsp: {command = "${lsp.pkg}/bin/${lsp.cmd}";});
|
2025-02-13 12:23:39 +10:00
|
|
|
|
};
|
2024-11-10 23:10:51 +10:00
|
|
|
|
};
|
|
|
|
|
|
}
|