From c8f8dc98e648d26c4b0170e04eafb758b3e58c35 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 9 May 2024 10:42:45 -0400 Subject: [PATCH] fix(nvim): setup lsps properly --- common/home/neovim/langs/nix.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/common/home/neovim/langs/nix.nix b/common/home/neovim/langs/nix.nix index b94c58d..b5a98c9 100644 --- a/common/home/neovim/langs/nix.nix +++ b/common/home/neovim/langs/nix.nix @@ -26,13 +26,6 @@ in home.packages = with pkgs; [ alejandra - - # FIXME: set nixd to use alejandra - (writeShellApplication { - name = "nixpkgs-fmt"; - runtimeInputs = [alejandra]; - text = "alejandra \"$@\""; - }) ]; xdg.dataFile."${flakeDir}/.nixd.json".text = builtins.toJSON { @@ -55,10 +48,15 @@ in lua */ '' - local lsp = require('lspconfig'); - - lsp.nixd.setup({}); - lsp.nixd.setup(require('coq').lsp_ensure_capabilities({})); + require('lspconfig').nixd.setup(require('coq').lsp_ensure_capabilities({ + settings = { + nixd = { + formatting = { + command = { "alejandra" }, + }, + }, + }, + })); ''; }; };