diff --git a/lib/options.nix b/lib/options.nix index 40c1af667619..b069cfc7d4f0 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -322,10 +322,16 @@ rec { showOption = parts: let escapeOptionPart = part: let - escaped = lib.strings.escapeNixString part; - in if escaped == "\"${part}\"" + # We assume that these are "special values" and not real configuration data. + # If it is real configuration data, it is rendered incorrectly. + specialIdentifiers = [ + "" # attrsOf (submodule {}) + "*" # listOf (submodule {}) + "" # functionTo + ]; + in if builtins.elem part specialIdentifiers then part - else escaped; + else lib.strings.escapeNixIdentifier part; in (concatStringsSep ".") (map escapeOptionPart parts); showFiles = files: concatStringsSep " and " (map (f: "`${f}'") files);