mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 18:58:43 +02:00
helpers/neovim-plugin: make use of helpers.mkSettingsOption
This commit is contained in:
parent
e3e14dbe1d
commit
100876b7a3
1 changed files with 12 additions and 20 deletions
|
@ -3,28 +3,20 @@
|
||||||
nixvimOptions,
|
nixvimOptions,
|
||||||
}:
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
mkSettingsOption = pluginName: options:
|
mkSettingsOption = {
|
||||||
mkOption {
|
pluginName ? null,
|
||||||
type = with types;
|
options ? {},
|
||||||
submodule {
|
description ?
|
||||||
freeformType = with types; attrsOf anything;
|
if pluginName != null
|
||||||
inherit options;
|
then "Options provided to the `require('${pluginName}').setup` function."
|
||||||
};
|
else throw "mkSettingsOption: Please provide either a `pluginName` or `description`.",
|
||||||
description = ''
|
example ? null,
|
||||||
Options provided to the `require('${pluginName}').setup` function.
|
}:
|
||||||
'';
|
nixvimOptions.mkSettingsOption {
|
||||||
default = {};
|
inherit options description example;
|
||||||
example = {
|
|
||||||
foo_bar = 42;
|
|
||||||
hostname = "localhost:8080";
|
|
||||||
callback.__raw = ''
|
|
||||||
function()
|
|
||||||
print('nixvim')
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO: DEPRECATED: use the `settings` option instead
|
||||||
extraOptionsOptions = {
|
extraOptionsOptions = {
|
||||||
extraOptions = mkOption {
|
extraOptions = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue