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, lib,
pkgs, pkgs,
config,
... ...
}: }:
let let
@ -91,6 +92,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
}; };
extraOptions = { extraOptions = {
enableTelescope = lib.mkEnableOption "the `package_info` telescope picker.";
packageManagerPackage = packageManagerPackage =
lib.mkPackageOption pkgs 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" ];
};
} }

View file

@ -28,4 +28,15 @@
}; };
}; };
}; };
with-telescope = {
plugins = {
telescope.enable = true;
package-info = {
enable = true;
enableTelescope = true;
};
};
};
} }