diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/types.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix index a7f9bf1946e..27b653ebb6c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -103,7 +103,8 @@ rec { path = mkOptionType { name = "path"; # Hacky: there is no ‘isPath’ primop. - check = x: builtins.substring 0 1 (toString x) == "/"; + # need to check isString first because otherwise toString throws an error. + check = x: builtins.isString x && builtins.substring 0 1 (toString x) == "/"; merge = mergeOneOption; }; |