plugins/yanky: sqlite-lua assertion

This commit is contained in:
Austin Horstman 2024-09-14 11:12:13 -05:00
parent da1a10d0f3
commit 34297f5e04
No known key found for this signature in database
2 changed files with 20 additions and 4 deletions

View file

@ -1,8 +1,8 @@
{
lib,
helpers,
config,
pkgs,
helpers,
options,
...
}:
with lib;
@ -347,6 +347,16 @@ helpers.neovim-plugin.mkNeovimPlugin {
callSetup = false;
extraConfig = cfg: {
# TODO: Added 2024-09-14 remove after 24.11
plugins.sqlite-lua.enable = mkOverride 1490 true;
warnings =
optional
(cfg.settings.ring.storage == "sqlite" && options.plugins.sqlite-lua.enable.highestPrio == 1490)
''
Nixvim (plugins.yanky) `sqlite-lua` automatic installation is deprecated.
Please use `plugins.sqlite-lua.enable`.
'';
assertions = [
{
assertion = cfg.enableTelescope -> config.plugins.telescope.enable;
@ -354,6 +364,13 @@ helpers.neovim-plugin.mkNeovimPlugin {
Nixvim (plugins.yanky): The telescope integration needs telescope to function as intended
'';
}
{
assertion = cfg.settings.ring.storage == "sqlite" -> config.plugins.sqlite-lua.enable;
message = ''
Nixvim (plugins.yanky): The sqlite storage backend needs `sqlite-lua` to function as intended.
You can enable it by setting `plugins.sqlite-lua.enable` to `true`.
'';
}
];
extraConfigLua = ''
@ -365,8 +382,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
end
'';
extraPlugins = mkIf (cfg.settings.ring.storage == "sqlite") [ pkgs.vimPlugins.sqlite-lua ];
plugins.telescope.enabledExtensions = mkIf cfg.enableTelescope [ "yank_history" ];
};
}

View file

@ -63,6 +63,7 @@
test.runNvim = false;
plugins = {
sqlite-lua.enable = true;
telescope.enable = true;
yanky = {