mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
top-level: Make overridePackages
extend rather than replace existing overrides
This commit is contained in:
parent
da36847d92
commit
e4cd45a30c
4 changed files with 77 additions and 64 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue