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:
Eelco Dolstra 2012-07-12 11:53:02 -04:00
parent 293027453f
commit 46dc120270

View file

@ -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;