From 01ce5ce0501327d37aa123c0ded432a5b87cea4b Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Tue, 30 Jun 2015 11:26:14 +0200 Subject: [PATCH] doc: document .override --- doc/functions.xml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/functions.xml b/doc/functions.xml index 16f4f262a25..89f2fda0ad4 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -54,4 +54,35 @@ in ... +
+ <pkg>.override + + + The function override is usually available for all the + derivations in the nixpkgs expression (pkgs). + + + It is used to override the arguments passed to a function. + + + Example usages: + + pkgs.foo.override { arg1 = val1; arg2 = val2; ... } + pkgs.overridePackages (self: super: { + foo = super.foo.override { barSupport = true ; }; +}) + mypkg = pkgs.callPackage ./mypkg.nix { + mydep = pkgs.mydep.override { ... }; +}) + + + + In the first example, pkgs.foo is the result of a function call + with some default arguments, usually a derivation. + Using pkgs.foo.override will call the same function with + the given new arguments. + + +
+