mkDerivation
pkgs.stdenv.mkDerivation
This function creates a derivation, and returns it in the form of a package attribute set that refers to the derivation's outputs.
mkDerivation
takes many argument attributes, most of which affect the derivation environment,
but meta
and passthru
only directly affect package attributes.
The mkDerivation
argument attributes can be made to refer to one another by passing a function to mkDerivation
.
See Fixed-point argument of mkDerivation
.
Reference documentation see: https://nixos.org/manual/nixpkgs/stable/#sec-using-stdenv
This is used as the fundamental building block of most other functions in Nixpkgs for creating derivations.
Most arguments are also passed through to the underlying call of builtins.derivation
.
Noogle detected
Implementation
The following is the current implementation of this function.
mkDerivation =
fnOrAttrs:
if builtins.isFunction fnOrAttrs
then makeDerivationExtensible fnOrAttrs
else makeDerivationExtensibleConst fnOrAttrs;