plugins/package-info: add telescope integration

This commit is contained in:
Austin Horstman 2024-09-17 23:56:54 -05:00
parent d4b1827606
commit b34379e981
No known key found for this signature in database
2 changed files with 28 additions and 1 deletions

View file

@ -1,6 +1,7 @@
{
lib,
pkgs,
config,
...
}:
let
@ -91,6 +92,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
};
extraOptions = {
enableTelescope = lib.mkEnableOption "the `package_info` telescope picker.";
packageManagerPackage =
lib.mkPackageOption pkgs
[
@ -104,5 +107,18 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
};
};
extraConfig = cfg: { extraPackages = [ cfg.packageManagerPackage ]; };
extraConfig = cfg: {
assertions = [
{
assertion = cfg.enableTelescope -> config.plugins.telescope.enable;
message = ''
Nixvim (plugins.package-info): The telescope integration needs telescope to function as intended.
'';
}
];
extraPackages = [ cfg.packageManagerPackage ];
plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "package_info" ];
};
}