mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/firenvim: fix aliasing settings
into globals
Needed to use `options.*.settings` instead of `config.*.settings`. I was concerned that the test-case didn't pick up on this, so I added an new test case with some basic assertions.
This commit is contained in:
parent
fab51138b7
commit
c46bd820ad
2 changed files with 46 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
options,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
@ -73,17 +74,21 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
callSetup = false;
|
callSetup = false;
|
||||||
extraConfig = cfg: {
|
extraConfig =
|
||||||
warnings =
|
let
|
||||||
lib.optional
|
opt = options.plugins.firenvim;
|
||||||
(
|
in
|
||||||
config.performance.combinePlugins.enable
|
cfg: {
|
||||||
&& !(lib.elem "firenvim" config.performance.combinePlugins.standalonePlugins)
|
warnings =
|
||||||
)
|
lib.optional
|
||||||
''
|
(
|
||||||
Nixvim (plugins.firenvim): Using `performance.combinePlugins` breaks `firenvim`.
|
config.performance.combinePlugins.enable
|
||||||
Add this plugin to `performance.combinePlugins.standalonePlugins` to prevent any issue.
|
&& !(lib.elem "firenvim" config.performance.combinePlugins.standalonePlugins)
|
||||||
'';
|
)
|
||||||
globals.firenvim_config = lib.modules.mkAliasAndWrapDefsWithPriority lib.id cfg.settings;
|
''
|
||||||
};
|
Nixvim (plugins.firenvim): Using `performance.combinePlugins` breaks `firenvim`.
|
||||||
|
Add this plugin to `performance.combinePlugins.standalonePlugins` to prevent any issue.
|
||||||
|
'';
|
||||||
|
globals.firenvim_config = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opt.settings;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,32 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
check-alias.module =
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.globals ? firenvim_config;
|
||||||
|
message = "`firenvim_config` should be present in globals";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = config.globals.firenvim_config.globalSettings.alt or null == "all";
|
||||||
|
message = "`globalSettings` should be have set `alt = \"all\"`";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = config.globals.firenvim_config.localSettings.".*".cmdline or null == "neovim";
|
||||||
|
message = "`localSettings` should be have set `\".*\".cmdline = \"neovim\"`";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
plugins.firenvim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
globalSettings.alt = "all";
|
||||||
|
localSettings.".*".cmdline = "neovim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue