mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/options: mkStr
quote default string
This commit is contained in:
parent
cedc1e4799
commit
b113bc69ea
1 changed files with 6 additions and 1 deletions
|
@ -111,7 +111,12 @@ rec {
|
|||
# Unsigned: >=0
|
||||
mkUnsignedInt = default: mkNullableWithRaw types.ints.unsigned (toString default);
|
||||
mkBool = default: mkNullableWithRaw types.bool (if default then "true" else "false");
|
||||
mkStr = default: mkNullableWithRaw types.str ''${builtins.toString default}'';
|
||||
mkStr =
|
||||
# TODO we should delegate rendering quoted string to `mkDefaultDesc`,
|
||||
# once we remove its special case for strings.
|
||||
default:
|
||||
assert default == null || isString default;
|
||||
mkNullableWithRaw types.str (generators.toPretty { } default);
|
||||
mkAttributeSet = default: mkNullable nixvimTypes.attrs ''${default}'';
|
||||
mkListOf = ty: default: mkNullable (with nixvimTypes; listOf (maybeRaw ty)) default;
|
||||
mkAttrsOf = ty: default: mkNullable (with nixvimTypes; attrsOf (maybeRaw ty)) default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue