78 lines
1.7 KiB
Nix
78 lines
1.7 KiB
Nix
{ enableDevIcons ? false
|
|
, enableBarBar ? false
|
|
, enableTabby ? false
|
|
, enableOrgMode ? false
|
|
, viAlias ? false
|
|
, vimAlias ? false
|
|
, extraConfig ? ""
|
|
, extraPlugins ? [ ]
|
|
, theme ? { }
|
|
, plugins ? { }
|
|
, wrapNeovim
|
|
, runCommand
|
|
, neovim-unwrapped
|
|
, tree-sitter
|
|
, neovimPlugins
|
|
, lib
|
|
, nix2lua
|
|
, substituteAll
|
|
, fetchFromGitHub
|
|
, ...
|
|
}:
|
|
|
|
let
|
|
inherit (builtins) catAttrs isFunction readFile;
|
|
myLib = import ./lib.nix { inherit lib; } // {
|
|
inherit substituteAll;
|
|
inherit (nix2lua.lib) toLua;
|
|
};
|
|
|
|
pluginParams = neovimPlugins // {
|
|
inherit runCommand tree-sitter fetchFromGitHub;
|
|
inherit plugins enableDevIcons enableTabby enableOrgMode;
|
|
themeCfg = theme;
|
|
lib = myLib;
|
|
};
|
|
|
|
callPlugin = op:
|
|
if isFunction op then op pluginParams else import op pluginParams;
|
|
callPlugins = list: map callPlugin list;
|
|
|
|
pluginsSettings = callPlugins [
|
|
./plugins/config
|
|
./plugins/syntax
|
|
./plugins/git
|
|
./plugins/explorer
|
|
./plugins/theme
|
|
./plugins/lsp
|
|
./plugins/formatter
|
|
./plugins/ux
|
|
];
|
|
|
|
basePlugins = [ neovimPlugins.plenary-nvim ];
|
|
customPlugins = catAttrs "plugins" pluginsSettings;
|
|
allPlugins = basePlugins ++ customPlugins ++ extraPlugins;
|
|
|
|
basicConfigs = map readFile [ ./config/basic.lua ];
|
|
pluginConfigs = catAttrs "luaConfig" pluginsSettings;
|
|
allConfigs = basicConfigs ++ pluginConfigs ++ [ extraConfig ];
|
|
in
|
|
(wrapNeovim neovim-unwrapped {
|
|
inherit viAlias;
|
|
inherit vimAlias;
|
|
|
|
withPython3 = false;
|
|
withNodeJs = false;
|
|
withRuby = false;
|
|
|
|
configure = {
|
|
customRC = myLib.mkLuaRc allConfigs;
|
|
|
|
packages.myVimPackages = { start = allPlugins; };
|
|
};
|
|
}).overrideAttrs (oldAttrs: {
|
|
passthru = oldAttrs.passthru // {
|
|
nix2lua = nix2lua.lib;
|
|
inherit plugins;
|
|
};
|
|
})
|