about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/options.nix9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 71481c9250ab..a53b8c9f264c 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -193,14 +193,7 @@ rec {
        (showOption ["foo" "bar" "baz"]) == "foo.bar.baz"
        (showOption ["foo" "bar.baz" "tux"]) == "foo.\"bar.baz\".tux"
   */
-  showOption = parts: let
-    escapeOptionPart = part:
-      let
-        escaped = lib.strings.escapeNixString part;
-      in if escaped == "\"${part}\""
-         then part
-         else escaped;
-    in (concatStringsSep ".") (map escapeOptionPart parts);
+  showOption = parts: concatMapStringsSep "." escapeNixIdentifier parts;
   showFiles = files: concatStringsSep " and " (map (f: "`${f}'") files);
   unknownModule = "<unknown-file>";