nixos/lib: use removePrefix in escapeSystemdPath

This commit is contained in:
florianjacob
2020-03-14 04:13:04 +01:00
committed by GitHub
parent 1b575dbd79
commit 8b07500163

View File

@@ -14,7 +14,7 @@ rec {
# becomes dev-xyzzy. FIXME: slow.
escapeSystemdPath = s:
replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"]
(if hasPrefix "/" s then substring 1 (stringLength s) s else s);
(removePrefix "/" s);
# Returns a system path for a given shell package
toShellPath = shell: