diff options
author | Charles Strahan <charles@cstrahan.com> | 2016-10-26 14:01:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-26 14:01:13 -0400 |
commit | ca2b03439f31dca0beee0d9b492dd18db78315cd (patch) | |
tree | 0e3a3830d1b797735f786c6ffce9c4e6ebe397e5 /lib/trivial.nix | |
parent | 6f1f1d86c1f6a82b44099d744cc52d150321e07e (diff) | |
parent | 3ca3b145ead9ce528b6b8cbf4db8e2a73a26bbe7 (diff) | |
download | nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.tar nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.tar.gz nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.tar.bz2 nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.tar.lz nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.tar.xz nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.tar.zst nixpkgs-ca2b03439f31dca0beee0d9b492dd18db78315cd.zip |
Merge pull request #19496 from Ericson2314/overridePackages
Make `overridePackages` extend rather than replace existing overrides
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r-- | lib/trivial.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index dac8b8d0106..39cbd67fba3 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -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. |