summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2017-04-12 15:53:50 +0200
committerDomen Kožar <domen@dev.si>2017-04-12 15:56:26 +0200
commit635822da82377d67a02588a58a5fc1e9c5abfc2c (patch)
treef24578bccf37464016ae0aac4d99cbf6b8934992 /nixos
parent8c5660807899a6c5c7e0f5e815770960181f8804 (diff)
downloadnixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.tar
nixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.tar.gz
nixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.tar.bz2
nixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.tar.lz
nixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.tar.xz
nixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.tar.zst
nixpkgs-635822da82377d67a02588a58a5fc1e9c5abfc2c.zip
nixos: escape brackets in systemd units
One day we should just whitelist instead of blacklist chars.

Fixes https://github.com/NixOS/nixops/issues/614
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/systemd-lib.nix2
1 files changed, 1 insertions, 1 deletions
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}"