From 46dc1202709142c4778a6da4bbf34d76e6fd4bdc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 12 Jul 2012 11:53:02 -0400 Subject: [PATCH] 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. --- pkgs/lib/types.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index 2c85ee0077a4..956368138aa2 100644 --- a/pkgs/lib/types.nix +++ b/pkgs/lib/types.nix @@ -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;