neovim/plugins/ux/default.nix

30 lines
1005 B
Nix
Raw Normal View History

2022-10-22 23:35:27 +03:00
{ lib
2022-11-19 00:56:53 +03:00
, plugins
2022-10-22 23:35:27 +03:00
, hop-nvim
, nvim-orgmode
2023-05-22 13:42:35 +03:00
, nvim-colorizer
2022-10-22 23:35:27 +03:00
, org-bullets-nvim
, enableOrgMode ? false
, ...
}:
2022-10-22 23:35:27 +03:00
let
inherit (builtins) readFile;
2022-11-19 00:56:53 +03:00
hopLuaConfig = readFile ./hop-nvim.lua;
2023-05-23 00:19:13 +03:00
orgmodeEnable = lib.attrByPath [ "orgmode" "enable" ] enableOrgMode plugins;
2022-11-19 00:56:53 +03:00
orgmodeSettings = lib.toLua (lib.attrByPath [ "orgmode" "settings" ] { } plugins);
2023-05-23 00:19:13 +03:00
orgmodeLuaConfig = lib.optional orgmodeEnable (readFile (lib.substituteAll { src = ./nvim-orgmode.lua; inherit orgmodeSettings; }));
2023-05-22 15:17:52 +03:00
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; });
2022-10-22 23:35:27 +03:00
in
{
luaConfig = hopLuaConfig + orgmodeLuaConfig + colorizerLuaConfig;
2023-05-22 13:42:35 +03:00
plugins = [ hop-nvim nvim-colorizer ]
2023-05-23 00:19:13 +03:00
++ lib.optional orgmodeEnable [ nvim-orgmode org-bullets-nvim ];
}