mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
add usage example to makeOverridable
svn path=/nixpkgs/trunk/; revision=15691
This commit is contained in:
parent
a50f278386
commit
62620f0411
@ -182,6 +182,10 @@ let
|
||||
in
|
||||
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 //
|
||||
{ override = newArgs:
|
||||
makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs));
|
||||
|
Loading…
Reference in New Issue
Block a user