From 124cccbe3b63122733e02e41e45a383ec48752fd Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 13 Mar 2020 02:45:26 +0100 Subject: [PATCH] lib/options: Use escapeNixIdentifier for showOption --- lib/options.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/options.nix b/lib/options.nix index 71481c9250ab2..a53b8c9f264c7 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 = "";