2012-10-12 22:01:49 +01:00
|
|
|
pkgs: with pkgs.lib;
|
|
|
|
|
|
|
|
rec {
|
|
|
|
|
|
|
|
# Escape a path according to the systemd rules, e.g. /dev/xyzzy
|
|
|
|
# becomes dev-xyzzy. FIXME: slow.
|
|
|
|
escapeSystemdPath = s:
|
2013-01-01 13:42:43 +00:00
|
|
|
replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"] (substring 1 (stringLength s) s);
|
2012-10-12 22:01:49 +01:00
|
|
|
|
|
|
|
}
|