Unverified Commit e89784e9 authored by Connor Baker's avatar Connor Baker Committed by GitHub
Browse files

stdenvAdapters: add `overrideMkDerivationArgs` (#496862)

parents 8106d8a6 3c4cf630
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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.