about summary refs log tree commit diff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2015-04-05T01·53-0400
committerShea Levy <shea@shealevy.com>2015-04-12T16·56-0400
commit1e4a4a2e9fc382f47f58b448f3ee034cdd28218a (patch)
treea844db5a4be5a57ac4ed2203c5ba6bb45cbf89a0 /src/libstore/globals.cc
parent4ed2187377bb915c0eac7f93f20afa3d16f79a5d (diff)
Add the pre-build hook.
This hook can be used to set system specific per-derivation build
settings that don't fit into the derivation model and are too complex or
volatile to be hard-coded into nix. Currently, the pre-build hook can
only add chroot dirs/files.

The specific use case for this is systems where the operating system ABI
is more complex than just the kernel-supported system calls. For
example, on OS X there is a set of system-provided frameworks that can
reliably be accessed by any program linked to them, no matter the
version the program is running on. Unfortunately, those frameworks do
not necessarily live in the same locations on each version of OS X, nor
do their dependencies, and thus nix needs to know the specific version
of OS X currently running in order to make those frameworks available.
The pre-build hook is a perfect mechanism for doing just that.
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index f900fb290bdb..143260674d8c 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -181,6 +181,7 @@ void Settings::update()
     _get(logServers, "log-servers");
     _get(enableImportNative, "allow-unsafe-native-code-during-evaluation");
     _get(useCaseHack, "use-case-hack");
+    _get(preBuildHook, "pre-build-hook");
 
     string subs = getEnv("NIX_SUBSTITUTERS", "default");
     if (subs == "default") {