diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 3ba6be2..66d4910 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -164,20 +164,49 @@ return { -- LSP Configuration & Plugins -- nvim 0.11 or above vim.lsp.config('vtsls', vtsls_config) vim.lsp.config('vue_ls', vue_ls_config) + -- vim.lsp.config('nixd', { + -- settings = { + -- nixpkgs = { + -- expr = "import { }" + -- }, + -- options = { + -- nixos = { + -- expr = '(builtins.getFlake "/etc/nixos/").nixosConfigurations.pcerik.options', + -- }, + -- home_manager = { + -- expr = '(builtins.getFlake "/etc/nixos").homeConfigurations.erik.options', + -- }, + -- } + -- } + -- }) vim.lsp.config('nixd', { - settings = { - nixpkgs = { - expr = "import { }" + cmd = { "nixd" }, + settings = { + nixd = { + nixpkgs = { + -- For flake. + -- This expression will be interpreted as "nixpkgs" toplevel + -- Nixd provides package, lib completion/information from it. + -- Resource Usage: Entries are lazily evaluated, entire nixpkgs takes 200~300MB for just "names". + -- Package documentation, versions, are evaluated by-need. + expr = "import (builtins.getFlake(toString ./.)).inputs.nixpkgs { }", + }, + formatting = { + command = { "alejandra" }, -- or nixfmt or nixpkgs-fmt + }, + options = { + nixos = { + expr = "let flake = builtins.getFlake(toString ./.); in flake.nixosConfigurations.webserver.options", }, - options = { - nixos = { - expr = '(builtins.getFlake "/etc/nixos/").nixosConfigurations.pcerik.options', - }, - home_manager = { - expr = '(builtins.getFlake "/etc/nixos").homeConfigurations.erik.options', - }, - } - } + -- home_manager = { + -- expr = 'let flake = builtins.getFlake(toString ./.); in flake.homeConfigurations."erik".options', + -- }, + -- darwin = { + -- expr = 'let flake = builtins.getFlake(toString ./.); in flake.darwinConfigurations."MacBook-Air-von-Erik".options', + -- }, + }, + }, + }, }) vim.lsp.config("ltex_plus", {