28 lines
926 B
Nix
28 lines
926 B
Nix
{ lib
|
|
, plugins
|
|
, hop-nvim
|
|
, nvim-orgmode
|
|
, nvim-colorizer
|
|
, org-bullets-nvim
|
|
, enableOrgMode ? false
|
|
, ...
|
|
}:
|
|
|
|
let
|
|
inherit (builtins) readFile;
|
|
|
|
hopLuaConfig = readFile ./hop-nvim.lua;
|
|
|
|
orgmodeSettings = lib.toLua (lib.attrByPath [ "orgmode" "settings" ] { } plugins);
|
|
orgmodeLuaConfig = lib.optional enableOrgMode (readFile (lib.substituteAll { src = ./nvim-orgmode.lua; inherit orgmodeSettings; }));
|
|
|
|
colorizerFiletypes = lib.toLua (lib.attrByPath [ "colorizer" "filetypes" ] lib.mkLuaNil plugins);
|
|
colorizerSettings = lib.toLua (lib.attrByPath [ "colorizer" "settings" ] lib.mkLuaNil plugins);
|
|
colorizerLuaConfig = readFile (lib.substituteAll { src = ./nvim-colorizer.lua; inherit colorizerFiletypes colorizerSettings; });
|
|
in
|
|
{
|
|
luaConfig = hopLuaConfig + orgmodeLuaConfig + colorizerLuaConfig;
|
|
|
|
plugins = [ hop-nvim nvim-colorizer ]
|
|
++ lib.optional enableOrgMode [ nvim-orgmode org-bullets-nvim ];
|
|
}
|