summary refs log tree commit diff
path: root/nixos/lib/utils.nix
diff options
context:
space:
mode:
authorflorianjacob <projects+git@florianjacob.de>2020-03-14 04:13:04 +0100
committerGitHub <noreply@github.com>2020-03-14 03:13:04 +0000
commit8b07500163819bcad8bedc37af52e700bf835405 (patch)
tree74299f06dbba6bd949ffac92f799b7da4686132a /nixos/lib/utils.nix
parent1b575dbd79682cb347140ac9b45996d1f3abe501 (diff)
downloadnixpkgs-8b07500163819bcad8bedc37af52e700bf835405.tar
nixpkgs-8b07500163819bcad8bedc37af52e700bf835405.tar.gz
nixpkgs-8b07500163819bcad8bedc37af52e700bf835405.tar.bz2
nixpkgs-8b07500163819bcad8bedc37af52e700bf835405.tar.lz
nixpkgs-8b07500163819bcad8bedc37af52e700bf835405.tar.xz
nixpkgs-8b07500163819bcad8bedc37af52e700bf835405.tar.zst
nixpkgs-8b07500163819bcad8bedc37af52e700bf835405.zip
nixos/lib: use removePrefix in escapeSystemdPath
Diffstat (limited to 'nixos/lib/utils.nix')
-rw-r--r--nixos/lib/utils.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix
index a522834e429..21f4c7c6988 100644
--- a/nixos/lib/utils.nix
+++ b/nixos/lib/utils.nix
@@ -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: