neovim-flake/modules/plugins/ui/noice/config.nix

32 lines
678 B
Nix
Raw Normal View History

2023-02-06 01:55:19 +01:00
{
config,
pkgs,
2023-02-06 01:55:19 +01:00
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.lists) optionals;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
2023-02-06 01:55:19 +01:00
cfg = config.vim.ui.noice;
tscfg = config.vim.treesitter;
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [vim regex lua bash markdown];
2023-02-06 01:55:19 +01:00
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"noice-nvim"
"nui-nvim"
];
treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars;
pluginRC.noice-nvim = entryAnywhere ''
require("noice").setup(${toLuaObject cfg.setupOpts})
'';
};
2023-02-06 01:55:19 +01:00
};
}