about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-11-19 11:40:46 +0100
committerArtturin <Artturin@artturin.com>2023-01-20 02:45:34 +0200
commit5b2f597b116d56104d45c35587920323ed2a5666 (patch)
treec842178a9d1d30db63e890c166f6b9d675876220 /lib
parentbff126ffbc49f1c1e08dc9c622081652a6a6e86d (diff)
lib.extendDerivation: Fix interaction between output selection and overrideAttrs
Diffstat (limited to 'lib')
-rw-r--r--lib/customisation.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 101c9e62b9e61..5b203552583b5 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;