diff options
Diffstat (limited to 'nixos/lib/utils.nix')
-rw-r--r-- | nixos/lib/utils.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 7b8be2050c13..871fbb121d03 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -8,4 +8,10 @@ rec { replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"] (if hasPrefix "/" s then substring 1 (stringLength s) s else s); + # Returns a system path for a given shell package + toShellPath = shell: + if types.shellPackage.check shell then + "/run/current-system/sw${shell.shellPath}" + else + shell; } |