diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 087787055c1e1..76c2cd3da4be1 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -644,15 +644,26 @@ extendDerivation printf "%s" "$(< "''${!pathVar}")" >> $out done '' ]; - - # inputDerivation produces the inputs; not the outputs, so any - # restrictions on what used to be the outputs don't serve a purpose - # anymore. - allowedReferences = null; - allowedRequisites = null; - disallowedReferences = [ ]; - disallowedRequisites = [ ]; - }); + } + // ( + let + sharedOutputChecks = { + # inputDerivation produces the inputs; not the outputs, so any + # restrictions on what used to be the outputs don't serve a purpose + # anymore. + allowedReferences = null; + allowedRequisites = null; + disallowedReferences = [ ]; + disallowedRequisites = [ ]; + }; + in + if __structuredAttrs then + { + outputChecks.out = sharedOutputChecks; + } + else + sharedOutputChecks + )); inherit passthru overrideAttrs; inherit meta;