diff --git a/doc/functions/overrides.xml b/doc/functions/overrides.xml index 99e2a63631a..30cc6f3f6b1 100644 --- a/doc/functions/overrides.xml +++ b/doc/functions/overrides.xml @@ -6,8 +6,16 @@ Sometimes one wants to override parts of nixpkgs, e.g. - derivation attributes, the results of derivations or even the whole package - set. + derivation attributes, the results of derivations. + + + + These overriding functions let you focus on one part of Nixpkgs and give you + back the requested variation. This is orthogonal but related to overlays and + the extending functions. Those also let you make modifications but return the + whole package set instead of just what you modified. When used together, the + override functions make the changes and overlays or extending functions add + those changes to the package sets.
@@ -25,6 +33,9 @@ Example usages: pkgs.foo.override { arg1 = val1; arg2 = val2; ... } + import pkgs.path { overlays = [ (self: super: { foo = super.foo.override { barSupport = true ; }; diff --git a/doc/overlays.xml b/doc/overlays.xml index 2decf9febe8..af1ab26b5e9 100644 --- a/doc/overlays.xml +++ b/doc/overlays.xml @@ -30,10 +30,16 @@ itself is given, then that is used. - This can be passed explicitly when importing nipxkgs, for example + This can be passed explicitly when importing nixpkgs, for example import <nixpkgs> { overlays = [ overlay1 overlay2 ]; }. + + Further overlays can be added by calling the + pkgs.extend or pkgs.appendOverlays, + although it is often preferable to avoid these functions, because they + recompute the Nixpkgs fixpoint, which is somewhat expensive to do. +