From 5dfb469faf199838b8c09e82b8778925e7fe307e Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Thu, 30 Jul 2015 17:56:16 +0200 Subject: doc: document .overrideDerivation --- doc/functions.xml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'doc/functions.xml') diff --git a/doc/functions.xml b/doc/functions.xml index 2aae3cfb2aec5..aec8a57c21a98 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -85,6 +85,44 @@ in ... +
+ <pkg>.overrideDerivation + + + The function overrideDerivation is usually available for all the + derivations in the nixpkgs expression (pkgs). + + + It is used to create a new derivation by overriding the attributes of + the original derivation according to the given function. + + + + Example usage: + + mySed = pkgs.gnused.overrideDerivation (oldAttrs: { + name = "sed-4.2.2-pre"; + src = fetchurl { + url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2; + sha256 = "11nq06d131y4wmf3drm0yk502d2xc6n5qy82cg88rb9nqd2lj41k"; + }; + patches = []; +}); + + + + In the above example, the name, src and patches of the derivation + will be overridden, while all other attributes will be retained from the + original derivation. + + + + The argument oldAttrs is used to refer to the attribute set of + the original derivation. + + +
+
lib.makeOverridable -- cgit 1.4.1