Skip to content

Commit 039db25

Browse files
authored
Doc: init stdenv.mkDerivation doc-comment (#343031)
2 parents 3fe7fe4 + f14a171 commit 039db25

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pkgs/stdenv/generic/make-derivation.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ let
4242
inherit (import ../../build-support/lib/cmake.nix { inherit lib stdenv; }) makeCMakeFlags;
4343
inherit (import ../../build-support/lib/meson.nix { inherit lib stdenv; }) makeMesonFlags;
4444

45+
/**
46+
This function creates a derivation, and returns it in the form of a [package attribute set](https://nix.dev/manual/nix/latest/glossary#package-attribute-set)
47+
that refers to the derivation's outputs.
48+
49+
`mkDerivation` takes many argument attributes, most of which affect the derivation environment,
50+
but [`meta`](#chap-meta) and [`passthru`](#var-stdenv-passthru) only directly affect package attributes.
51+
52+
The `mkDerivation` argument attributes can be made to refer to one another by passing a function to `mkDerivation`.
53+
See [Fixed-point argument of `mkDerivation`](#mkderivation-recursive-attributes).
54+
55+
Reference documentation see: https://nixos.org/manual/nixpkgs/stable/#sec-using-stdenv
56+
57+
:::{.note}
58+
This is used as the fundamental building block of most other functions in Nixpkgs for creating derivations.
59+
60+
Most Arguments are transparently forwarded to [`builtins.derivation`](https://nixos.org/manual/nix/stable/language/derivations).
61+
:::
62+
*/
4563
mkDerivation =
4664
fnOrAttrs:
4765
if builtins.isFunction fnOrAttrs

0 commit comments

Comments
 (0)