Merge pull request #26813 from gleber/stdenv-add-docs-makeOverridable
stdenv: add stawman docs for `makeOverridable`
This commit is contained in:
commit
3b6aac63e2
2 changed files with 19 additions and 1 deletions
|
@ -51,6 +51,24 @@ rec {
|
|||
else { }));
|
||||
|
||||
|
||||
/* `makeOverridable` takes a function from attribute set to attribute set and
|
||||
injects `override` attibute which can be used to override arguments of
|
||||
the function.
|
||||
|
||||
nix-repl> x = {a, b}: { result = a + b; }
|
||||
|
||||
nix-repl> y = lib.makeOverridable x { a = 1; b = 2; }
|
||||
|
||||
nix-repl> y
|
||||
{ override = «lambda»; overrideDerivation = «lambda»; result = 3; }
|
||||
|
||||
nix-repl> y.override { a = 10; }
|
||||
{ override = «lambda»; overrideDerivation = «lambda»; result = 12; }
|
||||
|
||||
Please refer to "Nixpkgs Contributors Guide" section
|
||||
"<pkg>.overrideDerivation" to learn about `overrideDerivation` and caveats
|
||||
related to its use.
|
||||
*/
|
||||
makeOverridable = f: origArgs:
|
||||
let
|
||||
ff = f origArgs;
|
||||
|
|
|
@ -130,7 +130,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
|||
in generateExprs name src {}) overrides;
|
||||
|
||||
# : { root : Path
|
||||
# , source-overrides : Defaulted (Either Path VersionNumber
|
||||
# , source-overrides : Defaulted (Either Path VersionNumber)
|
||||
# , overrides : Defaulted (HaskellPackageOverrideSet)
|
||||
# } -> NixShellAwareDerivation
|
||||
# Given a path to a haskell package directory whose cabal file is
|
||||
|
|
Loading…
Reference in a new issue