2022-09-19 18:44:57 +03:00
|
|
|
{ enableDevIcons ? false
|
|
|
|
, enableBarBar ? false
|
|
|
|
, enableTabby ? false
|
2022-10-22 23:35:27 +03:00
|
|
|
, enableOrgMode ? false
|
2022-09-20 09:20:55 +03:00
|
|
|
, viAlias ? false
|
|
|
|
, vimAlias ? false
|
2022-10-19 11:53:12 +03:00
|
|
|
, grammarFileTypes ? [ "nix" ]
|
2022-09-24 17:21:16 +03:00
|
|
|
, theme ? { }
|
2022-11-19 00:56:53 +03:00
|
|
|
, plugins ? { }
|
2022-09-18 12:15:44 +03:00
|
|
|
, wrapNeovim
|
|
|
|
, neovim-unwrapped
|
2022-09-24 17:21:16 +03:00
|
|
|
, tree-sitter
|
2022-11-17 23:44:45 +03:00
|
|
|
, neovimPlugins
|
2022-10-22 23:35:27 +03:00
|
|
|
, lib
|
2022-11-19 19:52:39 +03:00
|
|
|
, nix2lua
|
2022-11-19 00:56:53 +03:00
|
|
|
, substituteAll
|
2022-09-18 12:15:44 +03:00
|
|
|
, ...
|
|
|
|
}:
|
2022-09-15 01:29:25 +03:00
|
|
|
|
2022-09-15 09:57:11 +03:00
|
|
|
let
|
2022-10-22 23:35:27 +03:00
|
|
|
inherit (builtins) catAttrs isFunction readFile;
|
2022-11-19 19:52:39 +03:00
|
|
|
myLib = import ./lib.nix { inherit lib; } // {
|
|
|
|
inherit substituteAll;
|
|
|
|
inherit (nix2lua.lib) toLua;
|
|
|
|
};
|
2022-09-15 09:57:11 +03:00
|
|
|
|
2022-11-17 23:44:45 +03:00
|
|
|
pluginParams = neovimPlugins // {
|
2022-11-19 00:56:53 +03:00
|
|
|
inherit plugins;
|
2022-10-22 23:35:27 +03:00
|
|
|
inherit tree-sitter grammarFileTypes;
|
|
|
|
inherit enableDevIcons enableTabby enableOrgMode;
|
|
|
|
themeCfg = theme;
|
|
|
|
lib = myLib;
|
|
|
|
};
|
2022-09-17 15:59:06 +03:00
|
|
|
|
2022-10-22 23:35:27 +03:00
|
|
|
callPlugin = op:
|
|
|
|
if isFunction op then op pluginParams else import op pluginParams;
|
|
|
|
callPlugins = list: map callPlugin list;
|
2022-09-16 01:50:38 +03:00
|
|
|
|
2022-11-19 00:56:53 +03:00
|
|
|
pluginsSettings = callPlugins [
|
2022-09-19 19:03:40 +03:00
|
|
|
./plugins/config
|
2022-10-22 23:35:27 +03:00
|
|
|
./plugins/syntax
|
2022-09-18 16:32:54 +03:00
|
|
|
./plugins/git
|
2022-09-16 10:10:38 +03:00
|
|
|
./plugins/explorer
|
2022-10-22 23:35:27 +03:00
|
|
|
./plugins/theme
|
2022-09-16 10:10:38 +03:00
|
|
|
./plugins/lsp
|
2022-09-16 10:18:16 +03:00
|
|
|
./plugins/formatter
|
2022-09-18 16:10:03 +03:00
|
|
|
./plugins/ux
|
2022-09-15 09:57:11 +03:00
|
|
|
];
|
|
|
|
|
2022-11-17 23:44:45 +03:00
|
|
|
basePlugins = [ neovimPlugins.plenary-nvim ];
|
2022-11-19 00:56:53 +03:00
|
|
|
customPlugins = catAttrs "plugins" pluginsSettings;
|
2022-09-24 17:21:16 +03:00
|
|
|
allPlugins = basePlugins ++ customPlugins;
|
|
|
|
|
2022-10-22 23:35:27 +03:00
|
|
|
basicConfigs = map readFile [ ./config/basic.lua ];
|
2022-11-19 00:56:53 +03:00
|
|
|
pluginConfigs = catAttrs "luaConfig" pluginsSettings;
|
2022-09-16 10:10:38 +03:00
|
|
|
allConfigs = basicConfigs ++ pluginConfigs;
|
2022-09-15 09:57:11 +03:00
|
|
|
in
|
2022-11-19 19:52:39 +03:00
|
|
|
(wrapNeovim neovim-unwrapped {
|
2022-09-20 09:20:55 +03:00
|
|
|
inherit viAlias;
|
|
|
|
inherit vimAlias;
|
|
|
|
|
2022-09-15 01:29:25 +03:00
|
|
|
withPython3 = false;
|
|
|
|
withNodeJs = false;
|
|
|
|
withRuby = false;
|
|
|
|
|
|
|
|
configure = {
|
2022-10-22 23:35:27 +03:00
|
|
|
customRC = myLib.mkLuaRc allConfigs;
|
2022-09-15 01:29:25 +03:00
|
|
|
|
2022-09-24 17:21:16 +03:00
|
|
|
packages.myVimPackages = { start = allPlugins; };
|
2022-09-15 01:29:25 +03:00
|
|
|
};
|
2022-11-19 19:52:39 +03:00
|
|
|
}).overrideAttrs (oldAttrs: {
|
|
|
|
passthru = oldAttrs.passthru // {
|
|
|
|
nix2lua = nix2lua.lib;
|
2022-11-19 23:59:09 +03:00
|
|
|
inherit plugins;
|
2022-11-19 19:52:39 +03:00
|
|
|
};
|
|
|
|
})
|