From 8d07d76e2bfce0f128c4da1526137964bb261e1d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 23 Oct 2024 21:07:26 +0100 Subject: [PATCH] Replace `nil_ls` with `nixd` --- config/neovim/lua/opdavies/lsp/init.lua | 16 +++++++++++++++- lib/nixos/configuration.nix | 2 ++ lib/shared/modules/neovim.nix | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config/neovim/lua/opdavies/lsp/init.lua b/config/neovim/lua/opdavies/lsp/init.lua index 6ae90f7..baa328b 100644 --- a/config/neovim/lua/opdavies/lsp/init.lua +++ b/config/neovim/lua/opdavies/lsp/init.lua @@ -48,7 +48,21 @@ local servers = { }, marksman = true, - nil_ls = true, + + nixd = { + command = { "nixd" }, + settings = { + nixd = { + nixpkgs = { + expr = "import { }", + }, + + formatting = { + command = "nix fmt", + }, + }, + }, + }, tailwindcss = { filetypes = { "html", "javascript", "twig", "typescript", "vue" }, diff --git a/lib/nixos/configuration.nix b/lib/nixos/configuration.nix index 7a5f51f..5fca026 100644 --- a/lib/nixos/configuration.nix +++ b/lib/nixos/configuration.nix @@ -17,6 +17,8 @@ in permittedInsecurePackages = [ "electron-27.3.11" ]; }; + nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + # Bootloader. boot = { loader = { diff --git a/lib/shared/modules/neovim.nix b/lib/shared/modules/neovim.nix index 4de06f6..c86617f 100644 --- a/lib/shared/modules/neovim.nix +++ b/lib/shared/modules/neovim.nix @@ -281,7 +281,7 @@ in lua-language-server lua54Packages.luacheck marksman - nil + nixd nodePackages."@tailwindcss/language-server" nodePackages.bash-language-server nodePackages.dockerfile-language-server-nodejs