lib/types: enhances separatedString's description

The previous description "string" is misleading in the full options
manual pages; they are actually concatenated strings, with a specific
character.

The empty string version ("types.string") has been special-cased to
provide a better message.

(cherry picked from commit 0808c7cd31)
This commit is contained in:
Samuel Dionne-Riel
2018-10-11 21:23:11 -04:00
parent 29b9fee3fc
commit 03bf8cd487

View File

@@ -192,7 +192,10 @@ rec {
# separator between the values).
separatedString = sep: mkOptionType rec {
name = "separatedString";
description = "string";
description = if sep == ""
then "Concatenated string" # for types.string.
else "strings concatenated with ${builtins.toJSON sep}"
;
check = isString;
merge = loc: defs: concatStringsSep sep (getValues defs);
functor = (defaultFunctor name) // {