nixos: escape brackets in systemd units

One day we should just whitelist instead of blacklist chars.

Fixes https://github.com/NixOS/nixops/issues/614
This commit is contained in:
Domen Kožar 2017-04-12 15:53:50 +02:00
parent 8c56608078
commit 635822da82
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246

View file

@ -10,7 +10,7 @@ rec {
makeUnit = name: unit:
let
pathSafeName = lib.replaceChars ["@" ":" "\\"] ["-" "-" "-"] name;
pathSafeName = lib.replaceChars ["@" ":" "\\" "[" "]"] ["-" "-" "-" "" ""] name;
in
if unit.enable then
pkgs.runCommand "unit-${pathSafeName}"