- working nixd configuration on webserver TODO: add other systems

This commit is contained in:
2025-08-25 11:19:01 +02:00
parent 871fcb331e
commit 3df06fe85d

View File

@@ -164,20 +164,49 @@ return { -- LSP Configuration & Plugins
-- nvim 0.11 or above -- nvim 0.11 or above
vim.lsp.config('vtsls', vtsls_config) vim.lsp.config('vtsls', vtsls_config)
vim.lsp.config('vue_ls', vue_ls_config) vim.lsp.config('vue_ls', vue_ls_config)
-- vim.lsp.config('nixd', {
-- settings = {
-- nixpkgs = {
-- expr = "import <nixpkgs> { }"
-- },
-- options = {
-- nixos = {
-- expr = '(builtins.getFlake "/etc/nixos/").nixosConfigurations.pcerik.options',
-- },
-- home_manager = {
-- expr = '(builtins.getFlake "/etc/nixos").homeConfigurations.erik.options',
-- },
-- }
-- }
-- })
vim.lsp.config('nixd', { vim.lsp.config('nixd', {
cmd = { "nixd" },
settings = { settings = {
nixd = {
nixpkgs = { nixpkgs = {
expr = "import <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 = { options = {
nixos = { nixos = {
expr = '(builtins.getFlake "/etc/nixos/").nixosConfigurations.pcerik.options', expr = "let flake = builtins.getFlake(toString ./.); in flake.nixosConfigurations.webserver.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',
-- },
},
}, },
home_manager = {
expr = '(builtins.getFlake "/etc/nixos").homeConfigurations.erik.options',
}, },
}
}
}) })
vim.lsp.config("ltex_plus", { vim.lsp.config("ltex_plus", {