2023-06-04 09:41:10 +03:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
2023-11-06 17:50:27 -07:00
|
|
|
}: let
|
2024-03-23 20:14:39 -04:00
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
2025-12-17 16:44:44 +01:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
|
|
|
inherit (lib.generators) mkLuaInline;
|
2023-06-04 09:41:10 +03:00
|
|
|
cfg = config.vim.utility.ccc;
|
2025-12-17 16:44:44 +01:00
|
|
|
mkLuaIdentifier = prefix: identifier: mkLuaInline "${prefix}${identifier}";
|
|
|
|
|
mapSetupOptions = setupOpts:
|
|
|
|
|
setupOpts
|
|
|
|
|
// {
|
|
|
|
|
inputs = map (mkLuaIdentifier "ccc.input.") setupOpts.inputs;
|
|
|
|
|
outputs = map (mkLuaIdentifier "ccc.output.") setupOpts.outputs;
|
|
|
|
|
};
|
2023-06-04 09:41:10 +03:00
|
|
|
in {
|
2024-07-08 21:57:58 +00:00
|
|
|
config = mkIf cfg.enable {
|
2025-02-11 21:49:51 +03:00
|
|
|
vim.startPlugins = ["ccc-nvim"];
|
2023-06-04 09:41:10 +03:00
|
|
|
|
2024-07-20 10:30:48 +02:00
|
|
|
vim.pluginRC.ccc = entryAnywhere ''
|
2023-06-04 09:41:10 +03:00
|
|
|
local ccc = require("ccc")
|
2025-12-17 16:44:44 +01:00
|
|
|
ccc.setup(${toLuaObject (mapSetupOptions cfg.setupOpts)})
|
2023-06-04 09:41:10 +03:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
}
|