nixos: escape brackets in systemd units

One day we should just whitelist instead of blacklist chars.

Fixes https://github.com/NixOS/nixops/issues/614

Changed files
+1 -1
nixos
modules
system
+1 -1
nixos/modules/system/boot/systemd-lib.nix
···
makeUnit = name: unit:
let
-
pathSafeName = lib.replaceChars ["@" ":" "\\"] ["-" "-" "-"] name;
+
pathSafeName = lib.replaceChars ["@" ":" "\\" "[" "]"] ["-" "-" "-" "" ""] name;
in
if unit.enable then
pkgs.runCommand "unit-${pathSafeName}"