Skip to content

Commit 56208f9

Browse files
committed
plugins/telescope: add iconsPackage
1 parent bcda408 commit 56208f9

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

plugins/telescope/default.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
}:
77
with lib;
88
let
9-
inherit (lib.nixvim) keymaps mkNullOrOption toLuaObject;
9+
inherit (lib.nixvim)
10+
keymaps
11+
mkNullOrOption
12+
mkPackageOption
13+
toLuaObject
14+
;
1015
in
1116
# TODO:add support for additional filetypes. This requires autocommands!
1217
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
@@ -85,10 +90,17 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
8590
added to `extraPackages`.
8691
'';
8792
};
93+
94+
iconsPackage = mkPackageOption {
95+
name = "nvim-web-devicons";
96+
default = pkgs.vimPlugins.nvim-web-devicons;
97+
};
8898
};
8999

90100
callSetup = false;
91101
extraConfig = cfg: {
102+
extraPlugins = mkIf (cfg.iconsPackage != null) [ cfg.iconsPackage ];
103+
92104
extraConfigVim = mkIf (cfg.highlightTheme != null) ''
93105
let $BAT_THEME = '${cfg.highlightTheme}'
94106
'';

tests/test-sources/plugins/telescope/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@
3030
assert(vim.api.nvim_get_runtime_file("data/memes/planets/earth", false)[1], "telescope planets aren't found in runtime")
3131
'';
3232
};
33+
34+
no-packages = {
35+
plugins.telescope = {
36+
enable = true;
37+
iconsPackage = null;
38+
};
39+
};
3340
}

0 commit comments

Comments
 (0)