git.iko.soy/typeable/nixpkgs
on master help sign in
doc: document .override
01ce5ceLuca Bruno
doc/functions.xml+31
@@ -54,4 +54,35 @@ in ...</programlisting>
54
54
55</section>
55</section>
56
56
57+<section xml:id="sec-pkg-override">
58+ <title>&lt;pkg&gt;.override</title>
59+
60+ <para>
61+ The function <varname>override</varname> is usually available for all the
62+ derivations in the nixpkgs expression (<varname>pkgs</varname>).
63+ </para>
64+ <para>
65+ It is used to override the arguments passed to a function.
66+ </para>
67+ <para>
68+ Example usages:
69+
70+ <programlisting>pkgs.foo.override { arg1 = val1; arg2 = val2; ... }</programlisting>
71+ <programlisting>pkgs.overridePackages (self: super: {
72+ foo = super.foo.override { barSupport = true ; };
73+})</programlisting>
74+ <programlisting>mypkg = pkgs.callPackage ./mypkg.nix {
75+ mydep = pkgs.mydep.override { ... };
76+})</programlisting>
77+ </para>
78+
79+ <para>
80+ In the first example, <varname>pkgs.foo</varname> is the result of a function call
81+ with some default arguments, usually a derivation.
82+ Using <varname>pkgs.foo.override</varname> will call the same function with
83+ the given new arguments.
84+ </para>
85+
86+</section>
87+
57</chapter>
88</chapter>