mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-21 19:25:13 +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:
|
||||
assert default == null || isString default;
|
||||
mkNullableWithRaw types.str (generators.toPretty { } default);
|
||||
mkAttributeSet = mkNullable nixvimTypes.attrs;
|
||||
mkListOf = ty: default: mkNullable (with nixvimTypes; listOf (maybeRaw ty)) default;
|
||||
mkAttrsOf = ty: default: mkNullable (with nixvimTypes; attrsOf (maybeRaw ty)) default;
|
||||
|
||||
mkAttributeSet' = args: mkNullable' (args // { type = nixvimTypes.attrs; });
|
||||
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 =
|
||||
enumValues: default:
|
||||
mkNullableWithRaw (types.enum enumValues) (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue