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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ rec {
# becomes dev-xyzzy. FIXME: slow. # becomes dev-xyzzy. FIXME: slow.
escapeSystemdPath = s: escapeSystemdPath = s:
replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"] 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 # Returns a system path for a given shell package
toShellPath = shell: toShellPath = shell: