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

65 lines
1.4 KiB
Nix
Raw Normal View History

2022-09-19 18:44:57 +03:00
{ enableDevIcons ? false
, enableBarBar ? false
, enableTabby ? false
2022-10-22 23:35:27 +03:00
, enableOrgMode ? false
, viAlias ? false
, vimAlias ? false
, grammarFileTypes ? [ "nix" ]
2022-09-24 17:21:16 +03:00
, theme ? { }
2022-09-18 12:15:44 +03:00
, wrapNeovim
, neovim-unwrapped
2022-09-24 17:21:16 +03:00
, tree-sitter
2022-09-18 12:15:44 +03:00
, vimPlugins
2022-10-22 23:35:27 +03:00
, lib
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;
myLib = import ./lib.nix { inherit lib; };
2022-09-15 09:57:11 +03:00
2022-10-22 23:35:27 +03:00
pluginParams = vimPlugins // {
inherit tree-sitter grammarFileTypes;
inherit enableDevIcons enableTabby enableOrgMode;
themeCfg = theme;
lib = myLib;
};
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;
plugins = 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
./plugins/ux
2022-09-15 09:57:11 +03:00
];
2022-09-24 17:21:16 +03:00
basePlugins = [ vimPlugins.plenary-nvim ];
2022-10-22 23:35:27 +03:00
customPlugins = catAttrs "plugins" plugins;
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 ];
pluginConfigs = catAttrs "luaConfig" plugins;
2022-09-16 10:10:38 +03:00
allConfigs = basicConfigs ++ pluginConfigs;
2022-09-15 09:57:11 +03:00
in
2022-09-15 01:29:25 +03:00
wrapNeovim neovim-unwrapped {
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
};
}