Fix the "path" option type
Comparing a string with a context with "/" doesn't work because the "==" operator also compares context. So the context needs to be discarded.
This commit is contained in:
parent
293027453f
commit
46dc120270
|
@ -89,7 +89,7 @@ rec {
|
|||
path = mkOptionType {
|
||||
name = "path";
|
||||
# Hacky: there is no ‘isPath’ primop.
|
||||
check = lib.traceValIfNot (x: builtins.substring 0 1 (toString x) == "/");
|
||||
check = lib.traceValIfNot (x: builtins.unsafeDiscardStringContext (builtins.substring 0 1 (toString x)) == "/");
|
||||
};
|
||||
|
||||
listOf = types.list;
|
||||
|
|
Loading…
Reference in New Issue