mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
lib.callPackages(With): guard against a repeated mistake
For example see the parent commit.
This commit is contained in:
parent
fbe3eb29dd
commit
b63f684b3d
1 changed files with 6 additions and 1 deletions
|
@ -131,7 +131,12 @@ rec {
|
||||||
origArgs = auto // args;
|
origArgs = auto // args;
|
||||||
pkgs = f origArgs;
|
pkgs = f origArgs;
|
||||||
mkAttrOverridable = name: _: makeOverridable (newArgs: (f newArgs).${name}) origArgs;
|
mkAttrOverridable = name: _: makeOverridable (newArgs: (f newArgs).${name}) origArgs;
|
||||||
in lib.mapAttrs mkAttrOverridable pkgs;
|
in
|
||||||
|
if lib.isDerivation pkgs then throw
|
||||||
|
("function `callPackages` was called on a *single* derivation "
|
||||||
|
+ ''"${pkgs.name or "<unknown-name>"}";''
|
||||||
|
+ " did you mean to use `callPackage` instead?")
|
||||||
|
else lib.mapAttrs mkAttrOverridable pkgs;
|
||||||
|
|
||||||
|
|
||||||
/* Add attributes to each output of a derivation without changing
|
/* Add attributes to each output of a derivation without changing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue