mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-12-20 16:20:06 +01:00
Added `ccc.nvim` option `vim.utility.ccc.setupOpts` with the existing hard-coded options as default values.
27 lines
714 B
Nix
27 lines
714 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
inherit (lib.generators) mkLuaInline;
|
|
cfg = config.vim.utility.ccc;
|
|
mkLuaIdentifier = prefix: identifier: mkLuaInline "${prefix}${identifier}";
|
|
mapSetupOptions = setupOpts:
|
|
setupOpts
|
|
// {
|
|
inputs = map (mkLuaIdentifier "ccc.input.") setupOpts.inputs;
|
|
outputs = map (mkLuaIdentifier "ccc.output.") setupOpts.outputs;
|
|
};
|
|
in {
|
|
config = mkIf cfg.enable {
|
|
vim.startPlugins = ["ccc-nvim"];
|
|
|
|
vim.pluginRC.ccc = entryAnywhere ''
|
|
local ccc = require("ccc")
|
|
ccc.setup(${toLuaObject (mapSetupOptions cfg.setupOpts)})
|
|
'';
|
|
};
|
|
}
|