plugins/neoclip: sqlite-lua assertion

This commit is contained in:
Austin Horstman 2024-09-14 12:26:40 -05:00
parent e3e3774177
commit b42d4588ae
No known key found for this signature in database
2 changed files with 33 additions and 8 deletions

View file

@ -1,7 +1,8 @@
{ {
lib, lib,
config,
helpers, helpers,
pkgs, options,
... ...
}: }:
with lib; with lib;
@ -235,8 +236,30 @@ helpers.neovim-plugin.mkNeovimPlugin {
}; };
extraConfig = cfg: { extraConfig = cfg: {
extraPlugins = mkIf ( # TODO: added 2024-09-14 remove after 24.11
plugins.sqlite-lua.enable = mkOverride 1490 true;
warnings =
optional
(
isBool cfg.settings.enable_persistent_history
&& cfg.settings.enable_persistent_history
&& options.plugins.sqlite-lua.enable.highestPrio == 1490
)
''
Nixvim (plugins.neoclip) `sqlite-lua` automatic installation is deprecated.
Please use `plugins.sqlite-lua.enable`.
'';
assertions = [
{
assertion =
isBool cfg.settings.enable_persistent_history && cfg.settings.enable_persistent_history isBool cfg.settings.enable_persistent_history && cfg.settings.enable_persistent_history
) [ pkgs.vimPlugins.sqlite-lua ]; -> config.plugins.sqlite-lua.enable;
message = ''
Nixvim (plugins.neoclip): The persistent history sqlite storage backend needs `sqlite-lua` to function as intended.
You can enable it by setting `plugins.sqlite-lua.enable` to `true`.
'';
}
];
}; };
} }

View file

@ -8,13 +8,15 @@
# re-enable when sqlite fixed # re-enable when sqlite fixed
test.runNvim = false; test.runNvim = false;
plugins.neoclip = { plugins = {
sqlite-lua.enable = true;
neoclip = {
enable = true; enable = true;
# This triggers the addition of `pkgs.vimPlugins.sqlite-lua` to `extraPlugins`
settings.enable_persistent_history = true; settings.enable_persistent_history = true;
}; };
}; };
};
example = { example = {
plugins.neoclip = { plugins.neoclip = {