mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
helpers/options: add mkSettingsOption
This commit is contained in:
parent
3871b56b15
commit
e3e14dbe1d
1 changed files with 27 additions and 0 deletions
|
@ -237,4 +237,31 @@ with nixvimUtils; rec {
|
||||||
inherit default;
|
inherit default;
|
||||||
description = "Plugin to use for ${name}";
|
description = "Plugin to use for ${name}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkSettingsOption = {
|
||||||
|
options ? {},
|
||||||
|
description,
|
||||||
|
example ? null,
|
||||||
|
}:
|
||||||
|
mkOption {
|
||||||
|
type = with types;
|
||||||
|
submodule {
|
||||||
|
freeformType = with types; attrsOf anything;
|
||||||
|
inherit options;
|
||||||
|
};
|
||||||
|
default = {};
|
||||||
|
inherit description;
|
||||||
|
example =
|
||||||
|
if example == null
|
||||||
|
then {
|
||||||
|
foo_bar = 42;
|
||||||
|
hostname = "localhost:8080";
|
||||||
|
callback.__raw = ''
|
||||||
|
function()
|
||||||
|
print('nixvim')
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
else example;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue