mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-25 18:28:37 +02:00
plugins/package-info: add telescope integration
This commit is contained in:
parent
d4b1827606
commit
b34379e981
2 changed files with 28 additions and 1 deletions
|
@ -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" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue