feat: update nixd config

nixos
Moritz Böhme 2024-06-17 10:01:08 +02:00
parent a5a784b2d5
commit e45b2241fa
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
3 changed files with 22 additions and 10 deletions

View File

@ -1,9 +0,0 @@
{
"options": {
"enable": true,
"target": {
"args": [],
"installable": ".#nixosConfigurations.nixos-desktop.options"
}
}
}

View File

@ -67,6 +67,7 @@
outputs = inputs@{ self, flake-parts, ... }: outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
debug = true; # NOTE: for nixd
imports = [ imports = [
inputs.pre-commit-hooks.flakeModule inputs.pre-commit-hooks.flakeModule
inputs.devshell.flakeModule inputs.devshell.flakeModule

View File

@ -124,7 +124,6 @@ local servers = {
"gleam", "gleam",
"gopls", "gopls",
"nil_ls", "nil_ls",
"nixd",
"pylsp", "pylsp",
"ruff_lsp", "ruff_lsp",
"templ", "templ",
@ -134,6 +133,27 @@ for _, lsp in ipairs(servers) do
lspconfig_setup(lsp, {}) lspconfig_setup(lsp, {})
end end
lspconfig_setup("nixd", {
settings = {
nixd = {
nixpkgs = {
expr = "import <nixpkgs> { }",
},
options = {
nixos = {
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.nixos-desktop.options',
},
["flake-parts"] = {
expr = '(builtins.getFlake ("git+file://" + toString ./.)).debug.options',
},
["flake-parts2"] = {
expr = '(builtins.getFlake ("git+file://" + toString ./.)).currentSystem.options',
},
},
},
},
})
-- Add templ filetype -- Add templ filetype
vim.filetype.add({ extension = { templ = "templ" } }) vim.filetype.add({ extension = { templ = "templ" } })