nixos/modules/version: remove unnecessary quoting

(In cases it is unnecessary)
main
Vladimir Serov 2 years ago
parent 976a5bc9ff
commit 0c68e23f52
No known key found for this signature in database
GPG Key ID: 08AA9711F8CD40CF
  1. 6
      nixos/modules/misc/version.nix

@ -8,8 +8,12 @@ let
concatStringsSep mapAttrsToList toLower
literalExpression mkRenamedOptionModule mkDefault mkOption trivial types;
needsEscaping = s: null != builtins.match "[a-zA-Z0-9]+" s;
escapeIfNeccessary = s: if needsEscaping s then s else ''"${lib.escape [ "\$" "\"" "\\" "\`" ] s}"'';
attrsToText = attrs:
concatStringsSep "\n" (mapAttrsToList (n: v: ''${n}="${toString v}"'') attrs);
concatStringsSep "\n" (
mapAttrsToList (n: v: ''${n}=${escapeIfNeccessary (toString v)}'') attrs
);
in
{

Loading…
Cancel
Save