From 635822da82377d67a02588a58a5fc1e9c5abfc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 12 Apr 2017 15:53:50 +0200 Subject: [PATCH] nixos: escape brackets in systemd units One day we should just whitelist instead of blacklist chars. Fixes https://github.com/NixOS/nixops/issues/614 --- nixos/modules/system/boot/systemd-lib.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd-lib.nix b/nixos/modules/system/boot/systemd-lib.nix index 7dbf3b25cdb..7c01f8ea9b7 100644 --- a/nixos/modules/system/boot/systemd-lib.nix +++ b/nixos/modules/system/boot/systemd-lib.nix @@ -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}"