query
On this page

impureUseNativeOptimizations

pkgs.impureUseNativeOptimizations

Docs pulled from | This Revision | 8 minutes ago


Modify a stdenv so that it builds binaries optimized specifically for the machine they are built on.

WARNING: this breaks purity!

Inputs

stdenv

1. Function argument


Noogle detected

Implementation

The following is the current implementation of this function.

impureUseNativeOptimizations = stdenv:
    stdenv.override (old: {
      mkDerivationFromStdenv = extendMkDerivationArgs old (args: {
        env = (args.env or {}) // { NIX_CFLAGS_COMPILE = toString (args.env.NIX_CFLAGS_COMPILE or "") + " -march=native"; };

        NIX_ENFORCE_NO_NATIVE = false;

        preferLocalBuild = true;
        allowSubstitutes = false;
      });
    });