add usage example to makeOverridable

svn path=/nixpkgs/trunk/; revision=15691
This commit is contained in:
Marc Weber 2009-05-24 10:57:32 +00:00
parent a50f278386
commit 62620f0411

View File

@ -182,6 +182,10 @@ let
in in
import (dir + "/${pVersion}.nix") (args // { version = pVersion; }); import (dir + "/${pVersion}.nix") (args // { version = pVersion; });
# usage: (you can use override multiple times)
# let d = makeOverridable stdenv.mkDerivation { name = ..; buildInputs; }
# noBuildInputs = d.override { buildInputs = []; }
# additionalBuildInputs = d.override ( args : args // { buildInputs = args.buildInputs ++ [ additional ]; } )
makeOverridable = f: origArgs: f origArgs // makeOverridable = f: origArgs: f origArgs //
{ override = newArgs: { override = newArgs:
makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs)); makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs));