1diff --git a/test/lit.cfg b/test/lit.cfg
2index 118c979..b69fecc 100644
3--- a/test/lit.cfg
4+++ b/test/lit.cfg
5@@ -207,13 +207,8 @@ def is_preload_disabled():
6 if is_windows:
7 return True
8 elif sys.platform == 'darwin':
9- command = ['csrutil', 'status']
10- pattern = re.compile(r'System Integrity Protection status:\s+enabled')
11- try:
12- output = subprocess.check_output(command, stderr=subprocess.STDOUT)
13- return any(pattern.match(line) for line in output.decode('utf-8').splitlines())
14- except (OSError, subprocess.CalledProcessError):
15- return False
16+ # csrutil(8) isn't available in the Nix build sandbox.
17+ return True
18 else:
19 return False
20
21@@ -221,6 +216,11 @@ def is_preload_disabled():
22 if not is_preload_disabled():
23 config.available_features.add('preload')
24
25+# Preserve the variables required for the Nix toolchain wrappers.
26+for var, value in os.environ.items():
27+ if var.startswith('NIX_'):
28+ config.environment[var] = value
29+
30 print(config.substitutions)
31 print(config.environment)
32 print(config.available_features)