diff --git a/nix/home/default.nix b/nix/home/default.nix index 16dd998..20984c2 100644 --- a/nix/home/default.nix +++ b/nix/home/default.nix @@ -24,6 +24,8 @@ in # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ + comma # Comma runs software without installing it + nixd # Nix language server nixpkgs-fmt # Nix code formatter ]; }; diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index bba4664..313b183 100644 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -21,9 +21,32 @@ return { html = {}, jsonls = {}, lua_ls = {}, + nixd = {}, svelte = {}, tsserver = {}, yamlls = {}, }, }, + setup = function() + local nvim_lsp = require("lspconfig") + nvim_lsp.nixd.setup({ + cmd = { "nixd" }, + setttings = { + nixd = { + expr = "import { }", + }, + formattting = { + command = { "nixpkgs-fmt" }, + }, + options = { + nixos = { + expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.k-on.options', + }, + home_manager = { + expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."ruixi@k-on".options', + }, + }, + }, + }) + end, }