This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/default.nix

59 lines
1.3 KiB
Nix

{ enableDevIcons ? false
, enableBarBar ? false
, enableTabby ? false
, viAlias ? false
, vimAlias ? false
, theme ? { }
, wrapNeovim
, neovim-unwrapped
, tree-sitter
, 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/config
(import ./plugins/syntax {
inherit tree-sitter;
})
./plugins/git
./plugins/explorer
(import ./plugins/theme {
inherit enableDevIcons enableTabby;
inherit theme;
})
./plugins/lsp
./plugins/formatter
./plugins/ux
];
basePlugins = [ vimPlugins.plenary-nvim ];
customPlugins = builtins.catAttrs "plugins" plugins;
allPlugins = basePlugins ++ customPlugins;
basicConfigs = builtins.map builtins.readFile [ ./config/basic.lua ];
pluginConfigs = builtins.catAttrs "luaConfig" plugins;
allConfigs = basicConfigs ++ pluginConfigs;
in
wrapNeovim neovim-unwrapped {
inherit viAlias;
inherit vimAlias;
withPython3 = false;
withNodeJs = false;
withRuby = false;
configure = {
customRC = lib.mkLuaRc allConfigs;
packages.myVimPackages = { start = allPlugins; };
};
}