diff options
author | Samuel Dionne-Riel <samuel@dionne-riel.com> | 2018-10-11 21:23:11 -0400 |
---|---|---|
committer | Samuel Dionne-Riel <samuel@dionne-riel.com> | 2018-10-12 19:11:16 -0400 |
commit | 0808c7cd31aaa329aba21430b8b26c3a233dd83f (patch) | |
tree | e2696194b7a88b45935bd0933e05b8e27232c796 /lib/types.nix | |
parent | 0a7e258012b60cbe530a756f09a4f2516786d370 (diff) | |
download | nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.tar nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.tar.gz nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.tar.bz2 nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.tar.lz nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.tar.xz nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.tar.zst nixpkgs-0808c7cd31aaa329aba21430b8b26c3a233dd83f.zip |
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.
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix index 4e44e7521c4..ca6794e274c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -194,7 +194,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) // { |