{ wrapNeovim, neovim-unwrapped, vimPlugins, ... }:
let
lib = import ./lib.nix;
pluginParams = vimPlugins // { inherit lib; };
callPlugin = op: if builtins.isFunction op then op pluginParams else import op pluginParams;
callPlugins = list: builtins.map callPlugin list;
plugins = callPlugins [
./plugins/syntax
./plugins/explorer
(import ./plugins/theme { enableTabline = false; })
./plugins/lsp
./plugins/formatter
];
basicConfigs = builtins.map builtins.readFile [ ./config/basic.lua ];
pluginConfigs = builtins.catAttrs "luaConfig" plugins;
allConfigs = basicConfigs ++ pluginConfigs;
in
wrapNeovim neovim-unwrapped {
withPython3 = false;
withNodeJs = false;
withRuby = false;
configure = {
customRC = lib.mkLuaRc allConfigs;
packages.myVimPackages = { start = builtins.catAttrs "plugins" plugins; };
};
}