mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
standalone: Expose options
This can be used to teach `nixd` about NixVim options.
This commit is contained in:
parent
2705ce0ec6
commit
e035d22b64
2 changed files with 16 additions and 1 deletions
|
@ -55,3 +55,16 @@ The `config` used to produce a standalone nixvim derivation can be accessed as a
|
||||||
|
|
||||||
This may be useful if you want unrelated parts of your NixOS or home-manager configuration to use the same value as something in your nixvim configuration.
|
This may be useful if you want unrelated parts of your NixOS or home-manager configuration to use the same value as something in your nixvim configuration.
|
||||||
|
|
||||||
|
## Accessing nixvim options
|
||||||
|
|
||||||
|
Given a nixvim derivation it is possible to access the module options using `<derivation>.options`.
|
||||||
|
This can be useful to configure `nixd` for example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
plugins.lsp.servers.nixd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
options.nixvim.expr = ''(builtins.getFlake "/path/to/flake").packages.${system}.neovimNixvim.options'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
|
@ -44,7 +44,8 @@ let
|
||||||
mkNvim =
|
mkNvim =
|
||||||
mod:
|
mod:
|
||||||
let
|
let
|
||||||
config = handleAssertions (mkEval mod).config;
|
evaledModule = mkEval mod;
|
||||||
|
config = handleAssertions evaledModule.config;
|
||||||
in
|
in
|
||||||
(pkgs.symlinkJoin {
|
(pkgs.symlinkJoin {
|
||||||
name = "nixvim";
|
name = "nixvim";
|
||||||
|
@ -56,6 +57,7 @@ let
|
||||||
})
|
})
|
||||||
// {
|
// {
|
||||||
inherit config;
|
inherit config;
|
||||||
|
inherit (evaledModule) options;
|
||||||
nixvimExtend =
|
nixvimExtend =
|
||||||
extension:
|
extension:
|
||||||
mkNvim {
|
mkNvim {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue