lib: Fix matchAttrs by importing builtins.length

Before:

    nix-repl> :l <nixpkgs>
    nix-repl> lib.matchAttrs { foo = "bar"; } { bar = "bas"; }
    error: undefined variable ‘length’ at "/home/benley/nix/nixpkgs/lib/attrsets.nix":317:10

After:

    nix-repl> :l <nixpkgs>
    nix-repl> lib.matchAttrs { foo = "bar"; } { bar = "bas"; }
    false

Change-Id: I548d69d50cffe1c63a6f39f76fd09d1835d8d9a2
This commit is contained in:
Benjamin Staffin 2014-12-30 15:07:29 -08:00
parent d137ff33e2
commit 4dd93dbf25

View file

@ -1,7 +1,7 @@
# Operations on attribute sets.
with {
inherit (builtins) head tail;
inherit (builtins) head tail length;
inherit (import ./trivial.nix) or;
inherit (import ./default.nix) fold;
inherit (import ./strings.nix) concatStringsSep;