summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Mora Unie Youer <[email protected]>2025-03-06 21:06:39 +0300
committerLibravatar Mora Unie Youer <[email protected]>2025-03-06 21:06:39 +0300
commit9dbfef79b78a7fc9a02294c7ca6d0938186d205a (patch)
tree9133b206f82e1b8b84ea497bc32a5ce4dfb4d125
parentfeat: finally working LSP (diff)
downloadneovim-configuration-9dbfef79b78a7fc9a02294c7ca6d0938186d205a.tar.gz
neovim-configuration-9dbfef79b78a7fc9a02294c7ca6d0938186d205a.tar.bz2
neovim-configuration-9dbfef79b78a7fc9a02294c7ca6d0938186d205a.tar.lz
neovim-configuration-9dbfef79b78a7fc9a02294c7ca6d0938186d205a.tar.xz
neovim-configuration-9dbfef79b78a7fc9a02294c7ca6d0938186d205a.tar.zst
neovim-configuration-9dbfef79b78a7fc9a02294c7ca6d0938186d205a.zip
feat: add `nixd` language server
Diffstat (limited to '')
-rw-r--r--flake.nix15
-rw-r--r--lsp/nixd.lua21
-rw-r--r--lua/config/lsp.lua1
3 files changed, 27 insertions, 10 deletions
diff --git a/flake.nix b/flake.nix
index 9d55717..7aaaf67 100644
--- a/flake.nix
+++ b/flake.nix
@@ -103,6 +103,7 @@
lspsAndRuntimeDeps = {
general = with pkgs; {
lua = [ lua-language-server ];
+ nix = [ nix-doc nixd ];
};
};
@@ -210,6 +211,7 @@
aliases = [ "vim" ];
neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
};
+
# and a set of categories that you want
# (and other information to pass to lua)
categories = {
@@ -219,17 +221,10 @@
general = true;
gitPlugins = true;
customPlugins = true;
+ };
- test = true;
- example = {
- youCan = "add more than just booleans";
- toThisSet = [
- "and the contents of this categories set"
- "will be accessible to your lua with"
- "nixCats('path.to.value')"
- "see :help nixCats"
- ];
- };
+ extra = {
+ nixdExtras = { inherit nixpkgs; };
};
};
};
diff --git a/lsp/nixd.lua b/lsp/nixd.lua
new file mode 100644
index 0000000..3e899c3
--- /dev/null
+++ b/lsp/nixd.lua
@@ -0,0 +1,21 @@
+return {
+ cmd = { "nixd" },
+ filetypes = { "nix" },
+
+ settings = {
+ nixd = {
+ nixpkgs = {
+ expr = [[import (builtins.getFlake "]] .. nixCats.extra("nixdExtras.nixpkgs") .. [[") { } ]],
+ },
+
+ formatting = {
+ command = { "nixfmt" },
+ },
+
+ options = {
+ nixos = { expr = nixCats.extra("nixdExtras.nixos_options") },
+ ["home-manager"] = { expr = nixCats.extra("nixdExtras.home_manager_options") },
+ },
+ },
+ },
+}
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index c8444ef..37e3b6f 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -1 +1,2 @@
vim.lsp.enable("lua-language-server")
+vim.lsp.enable("nixd")