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,
config,
helpers,
pkgs,
options,
...
}:
with lib;
@ -235,8 +236,30 @@ helpers.neovim-plugin.mkNeovimPlugin {
};
extraConfig = cfg: {
extraPlugins = mkIf (
isBool cfg.settings.enable_persistent_history && cfg.settings.enable_persistent_history
) [ pkgs.vimPlugins.sqlite-lua ];
# 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
-> 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,11 +8,13 @@
# re-enable when sqlite fixed
test.runNvim = false;
plugins.neoclip = {
enable = true;
plugins = {
sqlite-lua.enable = true;
neoclip = {
enable = true;
# This triggers the addition of `pkgs.vimPlugins.sqlite-lua` to `extraPlugins`
settings.enable_persistent_history = true;
settings.enable_persistent_history = true;
};
};
};