Add an option ‘stdenv.userHook’ to set a global stdenv setup hook

This allows various applications.  It allows users to set global
optimisation flags, e.g.

  stdenv.userHook = ''NIX_CFLAGS_COMPILE+=" -funroll-loops"'';

But the impetus is as an alternative to issue #229, allowing impure
stdenv setup for people who want to use distcc:

  stdenv.userHook = "source /my/impure/setup-script.sh";

This is probably a bad idea, but at least now it's a bad idea in
people's configuration and not in Nixpkgs. :-)
This commit is contained in:
Eelco Dolstra
2012-12-28 16:36:09 +01:00
parent 6fd4f63530
commit cf8daf6312
7 changed files with 21 additions and 11 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
{ system, allPackages ? import ../../.. }:
{ system, allPackages ? import ../../.., config }:
rec {
@@ -98,7 +98,7 @@ rec {
fetchurlBoot = fetchurl;
inherit system shell gcc overrides;
inherit system shell gcc overrides config;
};