You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,8 @@ Lazy-Nix-Helper searches the nix store for all installed vim plugins and builds
28
28
29
29
## Requirements
30
30
31
+
Note: the docs list neovim version >= 0.9.0 as a requirement. It will probably work for much earlier versions, but that's all I've tested it on so far.
32
+
31
33
TODO:
32
34
- compatible neovim versions?
33
35
- nixos compatibility?
@@ -181,7 +183,13 @@ Mason is a package manager for LSP servers, DAP servers, linters, and formatters
181
183
182
184
This will require you to separately declare all your LSP servers etc. in your NixOS config, but you were doing that already, right?
183
185
184
-
Here's an example mason configuration as a dependency of `nvim-lspconfig`. Notice that we are using `mason_enabled` to conditionally enable both `mason` and `mason-lspconfig
186
+
There are two parts to this:
187
+
1. disabling the `mason` (and `mason-lspconfig`) plugins
188
+
2. checking that `mason` (and `mason-lspconfig`) are enabled before they are used elsewhere in your config
189
+
190
+
**Conditionally enabling mason**
191
+
192
+
Here's an example mason configuration as a dependency of `nvim-lspconfig`. Notice that we are using `mason_enabled` to conditionally enable both `mason` and `mason-lspconfig`
185
193
186
194
```Lua
187
195
{
@@ -190,13 +198,11 @@ Here's an example mason configuration as a dependency of `nvim-lspconfig`. Notic
@@ -206,8 +212,24 @@ Here's an example mason configuration as a dependency of `nvim-lspconfig`. Notic
206
212
}
207
213
```
208
214
209
-
TODO: do we have to load these things by hand now or is it sufficient to have them installed on the system?
215
+
Note that specifying the `dir` parameter is not necessary here since these plugins will be disabled in NixOS.
216
+
217
+
**Conditionally calling mason**
218
+
219
+
This part is harder to give examples for because there are a lot of ways you could be setting this up.
220
+
221
+
I based my original neovim configuration on [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim/tree/master), which had checks that `mason` and `mason-lspconfig` were enabled already built again. This was before they migrated to using Lazy, and it looks like this has changed sense.
222
+
223
+
Some general advice:
224
+
225
+
- You can still use the `mason_enabled()` function to gate `mason` or `mason-lspconfig` calls in your configuration
226
+
- Make sure that `lsp-config.setup()` function is still called for each server
227
+
228
+
After making these changes in my own config LSP servers were working for me on NixOS.
229
+
230
+
**Caveat for Linters and Formatters**
210
231
232
+
In my own config I don't use linters or formatters provided by mason. I prefer to handle that on a per-project basis or use tools provided by the language. I haven't tested this plugin with a configuration that includes linters or formatters, and can't confirm that they work with this setup.
0 commit comments