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:
@@ -7,7 +7,7 @@
|
||||
# The function defaults are for easy testing.
|
||||
{ system ? builtins.currentSystem
|
||||
, allPackages ? import ../../top-level/all-packages.nix
|
||||
, platform ? null }:
|
||||
, platform ? null, config }:
|
||||
|
||||
rec {
|
||||
|
||||
@@ -81,7 +81,7 @@ rec {
|
||||
{gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? [], fetchurl}:
|
||||
|
||||
import ../generic {
|
||||
inherit system;
|
||||
inherit system config;
|
||||
name = "stdenv-linux-boot";
|
||||
preHook =
|
||||
''
|
||||
@@ -261,7 +261,7 @@ rec {
|
||||
# dependency (`nix-store -qR') on bootstrapTools or the
|
||||
# first binutils built.
|
||||
stdenvLinux = import ../generic rec {
|
||||
inherit system;
|
||||
inherit system config;
|
||||
|
||||
preHook = commonPreHook;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user