diff --git a/pkgs/lib/attrsets.nix b/pkgs/lib/attrsets.nix index 263371f8e89..865e696369c 100644 --- a/pkgs/lib/attrsets.nix +++ b/pkgs/lib/attrsets.nix @@ -21,6 +21,7 @@ rec { then attrByPath (tail attrPath) default (getAttr attr e) else default; + /* Backwards compatibility hack: lib.attrByPath used to be called lib.getAttr, which was confusing given that there was also a builtins.getAttr. Eventually we'll drop this hack and diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 4777d7fb668..55e7c8ab1f8 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -3,6 +3,7 @@ let trivial = import ./trivial.nix; lists = import ./lists.nix; strings = import ./strings.nix; + stringsWithDeps = import ./strings-with-deps.nix; attrsets = import ./attrsets.nix; sources = import ./sources.nix; options = import ./options.nix; @@ -11,8 +12,8 @@ let misc = import ./misc.nix; in - { inherit trivial lists strings attrsets sources options meta debug; } + { inherit trivial lists strings stringsWithDeps attrsets sources options meta debug; } # !!! don't include everything at top-level; perhaps only the most # commonly used functions. - // trivial // lists // strings // attrsets // sources // options - // meta // debug // misc + // trivial // lists // strings // stringsWithDeps // attrsets // sources + // options // meta // debug // misc diff --git a/pkgs/lib/strings-with-deps.nix b/pkgs/lib/strings-with-deps.nix index a4246d73f1d..7543beddb52 100644 --- a/pkgs/lib/strings-with-deps.nix +++ b/pkgs/lib/strings-with-deps.nix @@ -40,9 +40,9 @@ Usage: [1] maybe this behaviour should be removed to keep things simple (?) */ -{stdenv, lib}: - -with lib; +with import ./lists.nix; +with import ./attrsets.nix; +with import ./strings.nix; rec { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b57ee3a7651..75ffe76ff5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -165,9 +165,7 @@ let builderDefsPackage = builderDefs.builderDefsPackage builderDefs; - stringsWithDeps = import ../lib/strings-with-deps.nix { - inherit stdenv lib; - }; + stringsWithDeps = lib.stringsWithDeps; # Call a specific version of a Nix expression, that is, # `selectVersion ./foo {version = "0.1.2"; args...}' evaluates to @@ -7232,10 +7230,7 @@ let inherit stdenv fetchurl mesa; wxGTK = wxGTK28deps {unicode = false;}; inherit (xlibs) libX11 xproto; - stringsWithDeps = import ../lib/strings-with-deps.nix { - inherit stdenv lib; - }; - inherit builderDefs; + inherit stringsWithDeps builderDefs; }; gemrb = import ../games/gemrb {