From 03bf8cd4870c281bddc959a799a320e66306e5cd Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 11 Oct 2018 21:23:11 -0400 Subject: [PATCH] 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 0808c7cd31aaa329aba21430b8b26c3a233dd83f) --- lib/types.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/types.nix b/lib/types.nix index 4d6ac51c8988..6d8e58dc0be8 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -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) // {