From 7c4b7d0db6a61f9a6e6aae186c5eaa420df1b736 Mon Sep 17 00:00:00 2001 From: pegasust Date: Mon, 10 Jul 2023 02:08:36 -0700 Subject: [PATCH] fix(nvim): nil_ls uses lspconfig instead of mason-lspconfig --- native_configs/neovim/init.lua | 51 ++++++++++++++++--------------- nix/repo/home-configs/default.nix | 2 +- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/native_configs/neovim/init.lua b/native_configs/neovim/init.lua index 20e2227..47bcce6 100644 --- a/native_configs/neovim/init.lua +++ b/native_configs/neovim/init.lua @@ -933,6 +933,32 @@ local inlay_hint_tsjs = { includeInlayVariableTypeHints = true, }; +local setup = { + ["nil_ls"] = function() + require('lspconfig').nil_ls.setup { + on_attach = on_attach, + capabilities = capabilities, + --- refer to https://github.com/oxalica/nil/blob/main/docs/configuration.md + --- for the list of configurations available for `nil_ls` + settings = { + ["nil"] = { + formatting = { + command = { "nix", "run", "nixpkgs#alejandra" }, + }, + nix = { + flake = { + -- calls `nix flake archive` to put a flake and its output to store + autoArchive = true, + -- auto eval flake inputs for improved completion + autoEvalInputs = true, + }, + }, + }, + }, + } + end, +} + require('mason-lspconfig').setup_handlers({ -- default handler function(server_name) @@ -1039,32 +1065,9 @@ require('mason-lspconfig').setup_handlers({ }, } end, - ["nil_ls"] = function() - require('lspconfig').nil_ls.setup { - on_attach = on_attach, - capabilities = capabilities, - --- refer to https://github.com/oxalica/nil/blob/main/docs/configuration.md - --- for the list of configurations available for `nil_ls` - settings = { - ["nil"] = { - formatting = { - command = { "nix", "run", "nixpkgs#alejandra" }, - }, - nix = { - flake = { - -- calls `nix flake archive` to put a flake and its output to store - autoArchive = true, - -- auto eval flake inputs for improved completion - autoEvalInputs = true, - }, - }, - }, - }, - } - end, }) -require('lspconfig')["nil_ls"].setup {} +setup["nil_ls"]() require("rust-tools").setup { tools = { -- rust-tools options diff --git a/nix/repo/home-configs/default.nix b/nix/repo/home-configs/default.nix index 4ed687c..c236424 100644 --- a/nix/repo/home-configs/default.nix +++ b/nix/repo/home-configs/default.nix @@ -63,7 +63,7 @@ in { base-modules ++ [ home-profiles.nerd_font_module - home-profiles.git-htran + home-profiles.git-pegasust home-profiles.dev-packages home-profiles.zk home-modules.darwin-spotlight