ux: configure colorize plugin via props

This commit is contained in:
Dmitriy Pleshevskiy 2023-05-22 14:15:44 +03:00
parent dc2181a344
commit ecd458f1d3
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
2 changed files with 9 additions and 4 deletions

View file

@ -11,12 +11,17 @@
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" ] { } plugins);
colorizerSettings = lib.toLua (lib.attrByPath [ "colorizer" "settings" ] { } plugins);
colorizerLuaConfig = readFile (lib.substituteAll { src = ./nvim-colorizer.lua; inherit colorizerFiletypes colorizerSettings; });
in
{
luaConfig = readFile ./hop-nvim.lua
+ lib.optional enableOrgMode (readFile (lib.substituteAll { src = ./nvim-orgmode.lua; inherit orgmodeSettings; }))
+ readFile ./nvim-colorizer.lua;
luaConfig = hopLuaConfig + orgmodeLuaConfig + colorizerLuaConfig;
plugins = [ hop-nvim nvim-colorizer ]
++ lib.optional enableOrgMode [ nvim-orgmode org-bullets-nvim ];

View file

@ -1 +1 @@
require("coloriazer").setup()
require("colorizer").setup(@colorizerFiletypes@, @colorizerSettings@)