mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-22 11:45:28 +02:00
lib/options: add mkAttrsOf'
& mkListOf'
(etc)
This commit is contained in:
parent
e0b60bac8b
commit
1bb4cb9c6c
1 changed files with 16 additions and 3 deletions
|
@ -171,9 +171,22 @@ rec {
|
||||||
default:
|
default:
|
||||||
assert default == null || isString default;
|
assert default == null || isString default;
|
||||||
mkNullableWithRaw types.str (generators.toPretty { } default);
|
mkNullableWithRaw types.str (generators.toPretty { } default);
|
||||||
mkAttributeSet = mkNullable nixvimTypes.attrs;
|
|
||||||
mkListOf = ty: default: mkNullable (with nixvimTypes; listOf (maybeRaw ty)) default;
|
mkAttributeSet' = args: mkNullable' (args // { type = nixvimTypes.attrs; });
|
||||||
mkAttrsOf = ty: default: mkNullable (with nixvimTypes; attrsOf (maybeRaw ty)) default;
|
mkAttributeSet = default: description: mkAttributeSet' { inherit default description; };
|
||||||
|
|
||||||
|
mkListOf' =
|
||||||
|
{ type, ... }@args: mkNullable' (args // { type = with nixvimTypes; listOf (maybeRaw type); });
|
||||||
|
mkListOf =
|
||||||
|
type: default: description:
|
||||||
|
mkListOf' { inherit type default description; };
|
||||||
|
|
||||||
|
mkAttrsOf' =
|
||||||
|
{ type, ... }@args: mkNullable' (args // { type = with nixvimTypes; attrsOf (maybeRaw type); });
|
||||||
|
mkAttrsOf =
|
||||||
|
type: default: description:
|
||||||
|
mkAttrsOf' { inherit type default description; };
|
||||||
|
|
||||||
mkEnum =
|
mkEnum =
|
||||||
enumValues: default:
|
enumValues: default:
|
||||||
mkNullableWithRaw (types.enum enumValues) (
|
mkNullableWithRaw (types.enum enumValues) (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue