stdenvAdapters: add overrideMkDerivationArgs (#496862)

This commit is contained in:
Connor Baker
2026-03-17 21:12:51 +00:00
committed by GitHub
+17
View File
@@ -215,6 +215,23 @@ rec {
mkDerivationFromStdenv = extendMkDerivationArgs old (_: extraAttrs);
});
/*
Modify a stdenv so as to extend `mkDerivation`'s arguments.
A stronger version of `addAttrsToDerivation`.
Example:
requireCcache =
overrideMkDerivationArgs
(oldAttrs: {
requiredSystemFeatures = oldAttrs.requiredSystemFeatures or [ ] ++ [ "ccache" ];
});
*/
overrideMkDerivationArgs =
extension: stdenv:
stdenv.override (old: {
mkDerivationFromStdenv = extendMkDerivationArgs old extension;
});
/*
Use the trace output to report all processed derivations with their
license name.