query
On this page

makeOverridable

lib.makeOverridable

Docs pulled from | This Revision | about 9 hours ago


makeOverridable takes a function from attribute set to attribute set and injects override attribute which can be used to override arguments of the function.

Please refer to documentation on <pkg>.overrideDerivation to learn about overrideDerivation and caveats related to its use.

Inputs

f

1. Function argument

Type

makeOverridable :: (AttrSet -> a) -> AttrSet -> a

Examples

lib.customisation.makeOverridable usage example

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; }
(lib.customisation.makeOverridable)

Noogle also knows

Aliases