diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-12 11:53:02 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-12 11:54:05 -0400 |
commit | 46dc1202709142c4778a6da4bbf34d76e6fd4bdc (patch) | |
tree | 5a293f3d25fa90c5a9395c89f90ff794db3e080e /pkgs/lib | |
parent | 293027453f713fce5b3a5b7660ce8003395a4604 (diff) | |
download | nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.tar nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.tar.gz nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.tar.bz2 nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.tar.lz nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.tar.xz nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.tar.zst nixlib-46dc1202709142c4778a6da4bbf34d76e6fd4bdc.zip |
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.
Diffstat (limited to 'pkgs/lib')
-rw-r--r-- | pkgs/lib/types.nix | 2 |
1 files changed, 1 insertions, 1 deletions
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; |