diff options
author | Shea Levy <shea@shealevy.com> | 2013-05-15 00:38:03 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2013-05-15 00:38:03 -0400 |
commit | 05a02c639e27ddfc8b3f9ef440a14fdccf821fc2 (patch) | |
tree | 869f436df986f04a6372108c326aed8e07711c94 /pkgs/lib/customisation.nix | |
parent | 880a386c5793269a30e052521b60bdf60b09a406 (diff) | |
download | nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.tar nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.tar.gz nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.tar.bz2 nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.tar.lz nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.tar.xz nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.tar.zst nixpkgs-05a02c639e27ddfc8b3f9ef440a14fdccf821fc2.zip |
Revert "Revert "Revert "Revert "overrideDerivation: Simplify""""
This reverts commit abf2d3677382bb93b989528cc6ed71ac6d5bd3b8. I will fix the breakage in upcoming commits. Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'pkgs/lib/customisation.nix')
-rw-r--r-- | pkgs/lib/customisation.nix | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pkgs/lib/customisation.nix b/pkgs/lib/customisation.nix index a35b44e9f6e..50816f99ec6 100644 --- a/pkgs/lib/customisation.nix +++ b/pkgs/lib/customisation.nix @@ -33,17 +33,14 @@ rec { overrideDerivation = drv: f: let - # Filter out special attributes. - drop = [ "meta" "passthru" "outPath" "drvPath" "crossDrv" "nativeDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ] - # also drop functions such as .merge .override etc - ++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv); - attrs = removeAttrs drv drop; - newDrv = derivation (attrs // (f drv)); + newDrv = derivation (drv.drvAttrs // (f drv)); in newDrv // - { meta = if drv ? meta then drv.meta else {}; + { meta = drv.meta or {}; passthru = if drv ? passthru then drv.passthru else {}; } // + (drv.passthru or {}) + // (if (drv ? crossDrv && drv ? nativeDrv) then { crossDrv = overrideDerivation drv.crossDrv f; |