query
On this page

callPackages

pkgs.callPackages

Docs pulled from | This Revision | 18 days ago


Contribute
Enhance the ecosystem with your expertise! Contribute to fill the gaps in documentation. Your input can make a difference.

Noogle detected

Implementation

The following is the current implementation of this function.

fn: args:
    let
      f = if isFunction fn then fn else import fn;
      auto = intersectAttrs (functionArgs f) autoArgs;
      mirrorArgs = mirrorFunctionArgs f;
      origArgs = auto // args;
      pkgs = f origArgs;
      mkAttrOverridable = name: _: makeOverridable (mirrorArgs (newArgs: (f newArgs).${name})) origArgs;
    in
    if 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
      mapAttrs mkAttrOverridable pkgs