nixpkgs/lib/utils.nix

11 lines
234 B
Nix
Raw Normal View History

pkgs: with pkgs.lib;
rec {
# Escape a path according to the systemd rules, e.g. /dev/xyzzy
# becomes dev-xyzzy. FIXME: slow.
escapeSystemdPath = s:
replaceChars ["/" "-"] ["-" "\\x2d"] (substring 1 (stringLength s) s);
}