From 3f6a821dc6e92af7a7107f24e2c741945c40b132 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Wed, 19 Aug 2026 18:36:58 -0500 Subject: [PATCH] feat(dev): add Rust toolchain and KDL language server support across editors - Apps: Add `cargo` and `rustc` to user environment applications. - Neovim: Configure `kdl_lsp` for `.kdl` files and add `kdl` Tree-sitter parser. - Zed: Register `kdl` extension, configure `kdl-lsp` binary path lookup, and bind the KDL language server. Note: Since the kdl-lsp binary isn't packaged in Nixpkgs, it should be installed globally via cargo: `cargo install kdl-lsp` --- modules/user/apps.nix | 4 ++++ modules/user/config/nvim/lsp.lua | 9 +++++++++ modules/user/config/zed/settings.json | 13 ++++++++++++- modules/user/graphical.nix | 3 ++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/modules/user/apps.nix b/modules/user/apps.nix index 30f8ced..75632a7 100644 --- a/modules/user/apps.nix +++ b/modules/user/apps.nix @@ -45,6 +45,10 @@ in ruff # Extremely fast Python linter and formatter mypy # Static type checker for Python + # Rust Tooling + cargo # Rust package manager + rustc # Rust compiler + # Secrets Management rbw # Unofficial command line client for Bitwarden ]; diff --git a/modules/user/config/nvim/lsp.lua b/modules/user/config/nvim/lsp.lua index 31df2c9..18b6d40 100644 --- a/modules/user/config/nvim/lsp.lua +++ b/modules/user/config/nvim/lsp.lua @@ -35,6 +35,15 @@ vim.lsp.enable('taplo') vim.lsp.config('marksman', {}) vim.lsp.enable('marksman') +-- KDL LSP: kdl-lsp (KDL Language Server) +-- Note: Install the server using: cargo install kdl-lsp +vim.lsp.config('kdl_lsp', { + cmd = { 'kdl-lsp' }, + filetypes = { 'kdl' }, + root_markers = { '.git' }, +}) +vim.lsp.enable('kdl_lsp') + -- Configure LSP Keybindings and features on attach vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('UserLspConfig', {}), diff --git a/modules/user/config/zed/settings.json b/modules/user/config/zed/settings.json index f5b133e..583be59 100644 --- a/modules/user/config/zed/settings.json +++ b/modules/user/config/zed/settings.json @@ -10,7 +10,8 @@ "proxy": "", "disable_ai": true, "auto_install_extensions": { - "github-theme": true + "github-theme": true, + "kdl": true }, "project_panel": { "hide_gitignore": false, @@ -105,6 +106,11 @@ "binary": { "path_lookup": true } + }, + "kdl-lsp": { + "binary": { + "path_lookup": true + } } }, "languages": { @@ -118,6 +124,11 @@ "name": "ruff" } } + }, + "KDL": { + "language_servers": [ + "kdl-lsp" + ] } } } diff --git a/modules/user/graphical.nix b/modules/user/graphical.nix index 2fd9183..77482b6 100644 --- a/modules/user/graphical.nix +++ b/modules/user/graphical.nix @@ -59,7 +59,7 @@ config = builtins.readFile ./config/nvim/catppuccin.lua; } - # Advanced Syntax Highlighting for developer workflows (Python, Rust, Java, Nix) + # Advanced Syntax Highlighting for developer workflows (Python, Rust, Java, Nix, KDL) (nvim-treesitter.withPlugins (p: with p; [ python rust @@ -68,6 +68,7 @@ java javascript markdown + kdl ])) # LSP Configuration & Python Language Servers