Skip to content

Commit

Permalink
lib/types: enhances separatedString's description
Browse files Browse the repository at this point in the history
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 0808c7c)
  • Loading branch information
samueldr committed Oct 12, 2018
1 parent 29b9fee commit 03bf8cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/types.nix
Expand Up @@ -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) // {
Expand Down

0 comments on commit 03bf8cd

Please sign in to comment.