From 5b2f597b116d56104d45c35587920323ed2a5666 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 19 Nov 2022 11:40:46 +0100 Subject: [PATCH] lib.extendDerivation: Fix interaction between output selection and overrideAttrs --- lib/customisation.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/customisation.nix b/lib/customisation.nix index 101c9e62b9e6143..5b203552583b54f 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -213,7 +213,14 @@ rec { outputSpecified = true; drvPath = assert condition; drv.${outputName}.drvPath; outPath = assert condition; drv.${outputName}.outPath; - }; + } // + # TODO: give the derivation control over the outputs. + # `overrideAttrs` may not be the only attribute that needs + # updating when switching outputs. + lib.optionalAttrs (passthru?overrideAttrs) { + # TODO: also add overrideAttrs when overrideAttrs is not custom, e.g. when not splicing. + overrideAttrs = f: (passthru.overrideAttrs f).${outputName}; + }; }; outputsList = map outputToAttrListElement outputs;