We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e543cbb + 0c68e23 commit 1e49b30Copy full SHA for 1e49b30
nixos/modules/misc/version.nix
@@ -8,8 +8,12 @@ let
8
concatStringsSep mapAttrsToList toLower
9
literalExpression mkRenamedOptionModule mkDefault mkOption trivial types;
10
11
+ needsEscaping = s: null != builtins.match "[a-zA-Z0-9]+" s;
12
+ escapeIfNeccessary = s: if needsEscaping s then s else ''"${lib.escape [ "\$" "\"" "\\" "\`" ] s}"'';
13
attrsToText = attrs:
- concatStringsSep "\n" (mapAttrsToList (n: v: ''${n}="${toString v}"'') attrs);
14
+ concatStringsSep "\n" (
15
+ mapAttrsToList (n: v: ''${n}=${escapeIfNeccessary (toString v)}'') attrs
16
+ );
17
18
in
19
{
0 commit comments