mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
3f6d53cc97
The new file ‘utils.nix’ is intended for NixOS-specific library functions (i.e. stuff that shouldn't go into Nixpkgs' lib/).
11 lines
234 B
Nix
11 lines
234 B
Nix
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);
|
|
|
|
}
|