diff --git a/doc/overlays.xml b/doc/overlays.xml
index cc0aef447d2d6..3e101e2b1e63e 100644
--- a/doc/overlays.xml
+++ b/doc/overlays.xml
@@ -88,35 +88,37 @@ as overlays.nix and imported as the value of nixpk
Defining overlays
Overlays are Nix functions which accept two arguments,
-conventionally called self and super,
+conventionally called final and previous,
and return a set of packages. For example, the following is a valid overlay.
-self: super:
+final: previous:
{
- boost = super.boost.override {
- python = self.python3;
+ boost = previous.boost.override {
+ python = final.python3;
};
- rr = super.callPackage ./pkgs/rr {
- stdenv = self.stdenv_32bit;
+ rr = previous.callPackage ./pkgs/rr {
+ stdenv = final.stdenv_32bit;
};
}
-The first argument (self) corresponds to the final package
-set. You should use this set for the dependencies of all packages specified in your
-overlay. For example, all the dependencies of rr in the example above come
-from self, as well as the overridden dependencies used in the
-boost override.
+The first argument (final) corresponds to the
+resulting package set after all the overlays are applied. You should use this
+set for the dependencies of all packages specified in your overlay. For
+example, all the dependencies of rr in the example above
+come from final, as well as the overridden dependencies
+used in the boost override.
-The second argument (super)
-corresponds to the result of the evaluation of the previous stages of
+The second argument (previous)
+corresponds to the the evaluation of Nixpkgs with the
+overlays applied prior to the application of the current overlay.
Nixpkgs. It does not contain any of the packages added by the current
overlay, nor any of the following overlays. This set should be used either
to refer to packages you wish to override, or to access functions defined
in Nixpkgs. For example, the original recipe of boost
-in the above example, comes from super, as well as the
+in the above example, comes from previous, as well as the
callPackage function.
The value returned by this function should be a set similar to
@@ -126,7 +128,7 @@ overridden and/or new packages.
Overlays are similar to other methods for customizing Nixpkgs, in particular
the packageOverrides attribute described in .
Indeed, packageOverrides acts as an overlay with only the
-super argument. It is therefore appropriate for basic use,
+previous argument. It is therefore appropriate for basic use,
but overlays are more powerful and easier to distribute.