2023-01-25 00:03:26 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2022-08-27 23:26:03 +00:00
|
|
|
with lib;
|
2022-08-28 00:43:01 +01:00
|
|
|
let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.plugins.telescope.extensions.media_files;
|
2023-01-25 19:46:49 +01:00
|
|
|
helpers = import ../helpers.nix { inherit lib; };
|
2022-08-27 23:26:03 +00:00
|
|
|
in
|
|
|
|
{
|
2022-09-18 11:19:23 +01:00
|
|
|
options.plugins.telescope.extensions.media_files = {
|
2022-08-27 23:26:03 +00:00
|
|
|
enable = mkEnableOption "Enable media_files extension for telescope";
|
|
|
|
|
2023-01-25 19:46:49 +01:00
|
|
|
package = helpers.mkPackageOption "telescope extension media_files" pkgs.vimPlugins.telescope-media-files-nvim;
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2022-08-27 23:26:03 +00:00
|
|
|
filetypes = mkOption {
|
2022-08-28 00:43:01 +01:00
|
|
|
default = null;
|
2022-08-27 23:26:03 +00:00
|
|
|
type = with types; nullOr (listOf str);
|
|
|
|
};
|
|
|
|
|
|
|
|
find_cmd = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = with types; nullOr str;
|
|
|
|
example = ''"rg"'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-09-18 11:19:23 +01:00
|
|
|
plugins.telescope.enabledExtensions = [ "media_files" ];
|
2022-08-27 23:26:03 +00:00
|
|
|
|
2022-09-18 11:19:23 +01:00
|
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
|
|
popup-nvim
|
|
|
|
plenary-nvim
|
2023-01-19 10:45:15 +00:00
|
|
|
cfg.package
|
2022-09-18 11:19:23 +01:00
|
|
|
];
|
2022-08-27 23:26:03 +00:00
|
|
|
|
2022-09-18 11:19:23 +01:00
|
|
|
extraPackages = with pkgs; [
|
|
|
|
ueberzug
|
|
|
|
];
|
2022-08-27 23:26:03 +00:00
|
|
|
};
|
|
|
|
}
|