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
See [lze](https://github.com/BirdeeHub/lze) and [lz.n](https://github.com/nvim-neorocks/lz.n), which work beautifully with this method of installing plugins.
23
+
It is just a table! Run `:=require(vim.g.nix_info_plugin_name)` to look at it!
25
24
26
-
They also work great with the builtin `neovim`plugin manager, `vim.pack.add`!
25
+
A useful function to see if nix installed a plugin for you is:
If you mark a spec as lazy, (or mark a parent spec and don't override the value in the child spec by default),
53
+
it will be placed in `pack/myNeovimPackages/opt/<pname>` on the runtime path.
54
+
55
+
It will not be loaded yet. Use `vim.cmd.packadd("<pname>")` to load it via `lua` (or `vimscript` or `fennel`) at a time of your choosing.
56
+
57
+
There are great plugins for this.
58
+
59
+
See [lze](https://github.com/BirdeeHub/lze) and [lz.n](https://github.com/nvim-neorocks/lz.n), which work beautifully with this method of installing plugins.
60
+
61
+
They also work great with the builtin `neovim` plugin manager, `vim.pack.add`!
62
+
63
+
`lze` can also be used to do some interesting bulk modifications to your plugins.
64
+
You might want to disable the ones nix didn't install automatically, for example.
65
+
You could use the `modify` field of a `handler` with `set_lazy = false` also set within it to do that,
66
+
using one of the functions from the previous tip.
50
67
51
68
---
52
69
53
-
-Make a new host!
70
+
-To use a different version of `neovim`, set `config.package` to the version you want to use!
54
71
55
72
```nix
56
-
config.hosts.neovide =
57
-
{
58
-
lib,
59
-
wlib,
60
-
pkgs,
61
-
...
62
-
}:
63
-
{
64
-
imports = [ wlib.modules.default ];
65
-
config.nvim-host.enable = lib.mkDefault false;
66
-
config.package = pkgs.neovide;
67
-
# also offers nvim-host wrapper arguments which run in the context of the final nvim drv!
- Change defaults and allow parent values to propagate default values to child specs:
162
+
163
+
```nix
164
+
config.specMods = { parentSpec, ... }: {
165
+
config.collateGrammars = lib.mkDefault (parentSpec.collateGrammars or true);
166
+
};
167
+
```
168
+
169
+
You have full control over them via the module system! This module will apply to the `wlib.types.spec` type of both specs in both the outer set and inner lists!
170
+
171
+
In the outer set, `parentSpec` is `null` and in the inner lists, it receives the `config` argument from the outer set!
172
+
173
+
It also receives `parentOpts`, which contains the `options` argument.
174
+
175
+
---
176
+
177
+
- You may want to move the installation of things like language servers into your specs. You can do that!
178
+
179
+
```nix
180
+
{ config, lib, wlib, ... }: {
181
+
config.specMods = {
182
+
options.extraPackages = lib.mkOption {
183
+
type = lib.types.listOf wlib.types.stringable;
184
+
default = [ ];
185
+
description = "a extraPackages spec field to put packages to suffix to the PATH";
- Use `specMaps` for advanced spec processing only when `specMods` and `specCollect` is not flexible enough.
195
+
196
+
`specMaps` has free-reign to modify the whole structure of specs provided as desired after the module evaluation,
197
+
before `specCollect` runs, and before the wrapper evaluates the builtin fields of the specs.
198
+
199
+
Be careful with this option, but an advanced user might use this to preprocess the items in truly amazing ways!
200
+
201
+
This also means items in `specCollect` may occasionally be missing fields, do not rely on them being there when using it! Use `or` to catch indexing errors.
202
+
203
+
---
204
+
205
+
- Make a new host!
206
+
207
+
```nix
208
+
# an attribute set of wrapper modules
209
+
config.hosts.neovide =
210
+
{
211
+
lib,
212
+
wlib,
213
+
pkgs,
214
+
...
215
+
}:
216
+
{
217
+
imports = [ wlib.modules.default ];
218
+
config.nvim-host.enable = lib.mkDefault false;
219
+
config.package = pkgs.neovide;
220
+
# also offers nvim-host wrapper arguments which run in the context of the final nvim drv!
0 commit comments