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/plugins/ux/default.nix

32 lines
970 B
Nix

{ lib
, plugins
, hop-nvim
, nvim-orgmode
, nvim-colorizer
, org-bullets-nvim
, enableOrgMode ? false
, ...
}:
let
inherit (builtins) readFile;
hopLuaConfig = readFile ./hop-nvim.lua;
orgmodeEnable = lib.attrByPath [ "orgmode" "enable" ] enableOrgMode plugins;
orgmodeSettings = lib.toLua (lib.attrByPath [ "orgmode" "settings" ] { } plugins);
orgmodeLuaConfig = lib.optional orgmodeEnable
(lib.readSubFile ./nvim-orgmode.lua { inherit orgmodeSettings; });
colorizerFiletypes = lib.toLua (lib.attrByPath [ "colorizer" "filetypes" ] lib.LuaNil plugins);
colorizerSettings = lib.toLua (lib.attrByPath [ "colorizer" "settings" ] lib.LuaNil plugins);
colorizerLuaConfig = lib.readSubFile ./nvim-colorizer.lua
{ inherit colorizerFiletypes colorizerSettings; };
in
{
luaConfig = hopLuaConfig + orgmodeLuaConfig + colorizerLuaConfig;
plugins = [ hop-nvim nvim-colorizer ]
++ lib.optional orgmodeEnable [ nvim-orgmode org-bullets-nvim ];
}