Merge pull request #19496 from Ericson2314/overridePackages

Make `overridePackages` extend rather than replace existing overrides
This commit is contained in:
Charles Strahan
2016-10-26 14:01:13 -04:00
committed by GitHub
4 changed files with 77 additions and 64 deletions

View File

@@ -69,9 +69,13 @@ rec {
#
# nix-repl> obj
# { __unfix__ = «lambda»; bar = "bar"; extend = «lambda»; foo = "foo + "; foobar = "foo + bar"; }
makeExtensible = rattrs:
makeExtensible = makeExtensibleWithCustomName "extend";
# Same as `makeExtensible` but the name of the extending attribute is
# customized.
makeExtensibleWithCustomName = extenderName: rattrs:
fix' rattrs // {
extend = f: makeExtensible (extends f rattrs);
${extenderName} = f: makeExtensibleWithCustomName extenderName (extends f rattrs);
};
# Flip the order of the arguments of a binary function.