Initial commit

This commit is contained in:
2026-03-31 16:53:11 +02:00
commit d0eba1c834
343 changed files with 34443 additions and 0 deletions
+162
View File
@@ -0,0 +1,162 @@
{pkgs, ...}: let
formatters = {
alejandra = "${pkgs.alejandra}/bin/alejandra";
biome = "${pkgs.biome}/bin/biome";
oxfmt = "${pkgs.oxfmt}/bin/oxfmt";
shfmt = "${pkgs.shfmt}/bin/shfmt";
};
languageServers = {
astro-ls = "${pkgs.astro-language-server}/bin/astro-ls";
biome = "${pkgs.biome}/bin/biome";
marksman = "${pkgs.marksman}/bin/marksman";
nil = "${pkgs.nil}/bin/nil";
tailwindcss = "${pkgs.tailwindcss-language-server}/bin/tailwindcss-language-server";
volar = "${pkgs.vue-language-server}/bin/vue-language-server";
};
in
(pkgs.formats.toml {}).generate "languages.toml" {
language = [
{
name = "bash";
auto-format = true;
formatter = {
command = formatters.shfmt;
args = ["-i" "2"];
};
}
{
name = "yaml";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.yaml"];
};
}
{
name = "astro";
auto-format = true;
formatter = {
command = formatters.biome;
args = ["format" "--stdin-file-path" "a.astro"];
};
language-servers = ["astro-ls" "tailwindcss"];
}
{
name = "javascript";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.js"];
};
language-servers = ["biome" "tailwindcss"];
}
{
name = "json";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.json"];
};
language-servers = ["biome"];
}
{
name = "jsx";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.jsx"];
};
language-servers = ["biome" "tailwindcss"];
}
{
name = "markdown";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.md"];
};
language-servers = ["marksman"];
}
{
name = "typescript";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.ts"];
};
language-servers = ["biome" "tailwindcss"];
}
{
name = "tsx";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.tsx"];
};
language-servers = ["biome" "tailwindcss"];
}
{
name = "css";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.css"];
};
language-servers = ["biome" "tailwindcss"];
}
{
name = "html";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.html"];
};
language-servers = ["tailwindcss"];
}
{
name = "vue";
auto-format = true;
formatter = {
command = formatters.oxfmt;
args = ["--stdin-filepath" "file.vue"];
};
language-servers = ["volar" "tailwindcss"];
}
{
name = "nix";
auto-format = true;
formatter = {
command = formatters.alejandra;
args = ["-q"];
};
language-servers = ["nil"];
}
];
language-server = {
astro-ls = {
command = languageServers.astro-ls;
args = ["--stdio"];
};
biome = {
command = languageServers.biome;
args = ["lsp-proxy"];
};
nil = {
command = languageServers.nil;
config.nil.formatting.command = [formatters.alejandra "-q"];
};
marksman = {
command = languageServers.marksman;
};
tailwindcss = {
command = languageServers.tailwindcss;
args = ["--stdio"];
};
volar = {
command = languageServers.volar;
args = ["--stdio"];
};
};
}
+141
View File
@@ -0,0 +1,141 @@
{pkgs, ...}: let
configFile = "helix/config.toml";
toTOML = (pkgs.formats.toml {}).generate;
languagesTOML = import ./_languages.nix {inherit pkgs;};
lspPackages = with pkgs; [
# Language Server Protocol
astro-language-server
biome
marksman
nil
tailwindcss-language-server
vue-language-server
# Formatters
alejandra
oxfmt
shfmt
];
lspBinPath = pkgs.buildEnv {
name = "helix-lsp-env";
paths = lspPackages;
pathsToLink = ["/bin"];
};
helixWithLSP =
pkgs.runCommand "helix-with-lsp" {
buildInputs = [pkgs.makeWrapper];
} ''
mkdir -p $out/bin
makeWrapper ${pkgs.helix}/bin/hx $out/bin/hx \
--prefix PATH : ${lspBinPath}/bin
for bin in ${pkgs.helix}/bin/*; do
if [ "$(basename $bin)" != "hx" ]; then
ln -s $bin $out/bin/$(basename $bin)
fi
done
'';
in {
users.users.someone.packages = [
helixWithLSP
];
xdg.configFile."${configFile}".source = toTOML "config.toml" {
theme = "noctalia";
editor = {
color-modes = true;
completion-trigger-len = 1;
completion-replace = true;
cursorline = true;
bufferline = "multiple";
line-number = "relative";
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
undercurl = true;
true-color = true;
soft-wrap.enable = true;
indent-guides = {
render = true;
rainbow-option = "dim";
};
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
max-diagnostics = 3;
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
gutters = ["diagnostics" "line-numbers" "spacer" "diff"];
statusline = {
left = ["mode" "spacer" "version-control"];
center = ["file-modification-indicator" "file-name" "spinner"];
right = ["diagnostics" "selections" "position" "position-percentage" "total-line-numbers"];
mode = {
normal = "NORMAL";
insert = "INSERT";
select = "SELECT";
};
};
trim-final-newlines = true;
trim-trailing-whitespace = true;
whitespace = {
render = {
space = "all";
tab = "all";
newline = "all";
};
characters = {
space = " ";
nbsp = "";
tab = "";
newline = "";
tabpad = "-";
};
};
auto-pairs = true;
clipboard-provider = "wayland";
};
keys.insert = {
C-h = "move_char_left";
C-j = "move_line_down";
C-k = "move_line_up";
C-l = "move_char_right";
C-e = "goto_line_end";
C-b = "goto_line_start";
};
keys.normal = {
A-j = ["extend_to_line_bounds" "delete_selection" "paste_after"];
A-k = ["extend_to_line_bounds" "delete_selection" "move_line_up" "paste_before"];
A-h = ["delete_selection" "move_char_left" "paste_before"];
A-l = ["delete_selection" "move_char_right" "paste_after"];
C-h = ["jump_view_left"];
C-j = ["jump_view_down"];
C-k = ["jump_view_up"];
C-l = ["jump_view_right"];
tab = ["goto_next_buffer"];
S-tab = ["goto_previous_buffer"];
space = {x = ":buffer-close";};
space.u = {
f = ":format";
w = ":set whitespace.render all";
W = ":set whitespace.render none";
};
};
};
xdg.configFile."helix/languages.toml".source = languagesTOML;
}