treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -5,7 +5,8 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.plugins.illuminate;
mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str);
@ -64,9 +65,11 @@ with lib; let
Filetypes to illuminate, this is overridden by `filetypes_denylist`.
'';
};
in {
options.plugins.illuminate = with helpers;
with defaultNullOpts;
in
{
options.plugins.illuminate =
with helpers;
with defaultNullOpts;
helpers.neovim-plugin.extraOptionsOptions
// {
enable = mkEnableOption "vim-illuminate";
@ -75,63 +78,65 @@ in {
filetypeOverrides =
helpers.defaultNullOpts.mkNullable
(with types; attrsOf (submodule {options = commonOptions;}))
"{}"
''
Filetype specific overrides.
The keys are strings to represent the filetype.
'';
(
with types;
attrsOf (submodule {
options = commonOptions;
})
)
"{}"
''
Filetype specific overrides.
The keys are strings to represent the filetype.
'';
largeFileOverrides = mkOption {
type = types.submodule {
options = commonOptions // filetypeOptions;
};
type = types.submodule { options = commonOptions // filetypeOptions; };
description = ''
Config to use for large files (based on large_file_cutoff).
Supports the same keys passed to .configure
If null, illuminate will be disabled for large files.
'';
default = {};
default = { };
};
}
// commonOptions
// filetypeOptions;
config = let
filetypeSetupOptions = filetypeOptions:
with filetypeOptions; {
filetypes_denylist = filetypesDenylist;
filetypes_allowlist = filetypesAllowlist;
};
commonSetupOptions = opts:
with opts; {
inherit providers;
inherit delay;
modes_denylist = modesDenylist;
modes_allowlist = modesAllowlist;
providers_regex_syntax_denylist = providersRegexSyntaxDenylist;
providers_regex_syntax_allowlist = providersRegexSyntaxAllowlist;
under_cursor = underCursor;
large_file_cutoff = largeFileCutoff;
min_count_to_highlight = minCountToHighlight;
};
setupOptions = with cfg;
{
large_file_overrides = (commonSetupOptions largeFileOverrides) // (filetypeSetupOptions largeFileOverrides);
config =
let
filetypeSetupOptions =
filetypeOptions: with filetypeOptions; {
filetypes_denylist = filetypesDenylist;
filetypes_allowlist = filetypesAllowlist;
};
commonSetupOptions =
opts: with opts; {
inherit providers;
inherit delay;
modes_denylist = modesDenylist;
modes_allowlist = modesAllowlist;
providers_regex_syntax_denylist = providersRegexSyntaxDenylist;
providers_regex_syntax_allowlist = providersRegexSyntaxAllowlist;
under_cursor = underCursor;
large_file_cutoff = largeFileCutoff;
min_count_to_highlight = minCountToHighlight;
};
setupOptions =
with cfg;
{
large_file_overrides =
(commonSetupOptions largeFileOverrides) // (filetypeSetupOptions largeFileOverrides);
filetype_overrides =
helpers.ifNonNull' filetypeOverrides
(
mapAttrs
(_: commonSetupOptions)
filetypeOverrides
filetype_overrides = helpers.ifNonNull' filetypeOverrides (
mapAttrs (_: commonSetupOptions) filetypeOverrides
);
}
// (filetypeSetupOptions cfg)
// (commonSetupOptions cfg);
in
}
// (filetypeSetupOptions cfg)
// (commonSetupOptions cfg);
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require("illuminate").configure(${helpers.toLuaObject setupOptions})