telescope.media_files: init (#29)

* telescope.media_files: init

* telescope-media: fix typo

`nollOr` -> `nullOr`

Co-authored-by: Pedro Alves <pta2002@users.noreply.github.com>
This commit is contained in:
Alexander Nortung 2022-08-27 23:26:03 +00:00 committed by GitHub
parent 3bb3b7efb5
commit 3bce3ed48f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

View file

@ -9,6 +9,7 @@ in
./frecency.nix
./fzf-native.nix
./fzy-native.nix
./media-files.nix
];
# TODO:add support for aditional filetypes. This requires autocommands!

View file

@ -0,0 +1,38 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.nixvim.plugins.telescope.extensions.media_files;
in
{
options.programs.nixvim.plugins.telescope.extensions.media_files = {
enable = mkEnableOption "Enable media_files extension for telescope";
filetypes = mkOption {
default = types.null;
type = with types; nullOr (listOf str);
};
find_cmd = mkOption {
default = null;
type = with types; nullOr str;
example = ''"rg"'';
};
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins.telescope.enabledExtensions = [ "media_files" ];
extraPlugins = with pkgs.vimPlugins; [
popup-nvim
plenary-nvim
telescope-media-files-nvim
];
extraPackages = with pkgs; [
ueberzug
];
};
};
}