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

33 lines
974 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-06-09 14:37:25 +03:00
orgmodeLuaConfig = lib.optional orgmodeEnable
(lib.readSubFile ./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);
2023-06-09 14:37:25 +03:00
colorizerLuaConfig = lib.readSubFile ./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 ];
}