about summary refs log tree commit diff
path: root/third_party/nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-04T21·02+0100
committertazjin <mail@tazj.in>2020-08-05T11·37+0000
commit3f923b2aa0d976fb18e7038d4e2701e878c6784b (patch)
tree6a786f324ddf3c6fb39fe3786ce120313a0f9f5c /third_party/nix
parentffa8e7a9986260280b5a3f415f73b47a53ba25c3 (diff)
refactor(tvix): Use SANDBOX_SHELL from environment in CMake r/1597
This makes the configuration work out-of-the-box using CMake in a Nix
shell, rather than having to pass the additional variable to CMake on
the command line.

Change-Id: I04d3cc4f2e5ecf47bf2ee459d5e48588b84ae4dd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1643
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'third_party/nix')
-rw-r--r--third_party/nix/CMakeLists.txt4
-rw-r--r--third_party/nix/default.nix3
2 files changed, 4 insertions, 3 deletions
diff --git a/third_party/nix/CMakeLists.txt b/third_party/nix/CMakeLists.txt
index e37bef9383b3..200b604c22f8 100644
--- a/third_party/nix/CMakeLists.txt
+++ b/third_party/nix/CMakeLists.txt
@@ -40,7 +40,9 @@ if (CLANG_TIDY_PATH)
   endif()
 endif()
 
-if (NOT SANDBOX_SHELL)
+if (DEFINED ENV{SANDBOX_SHELL})
+  set(SANDBOX_SHELL ENV{SANDBOX_SHELL})
+else()
   find_program(BUSYBOX busybox)
   if (BUSYBOX)
     set(SANDBOX_SHELL "${BUSYBOX}")
diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix
index 1056a3cbb4ad..f9ed4749e6b5 100644
--- a/third_party/nix/default.nix
+++ b/third_party/nix/default.nix
@@ -95,8 +95,7 @@ in lib.fix (self: pkgs.llvmPackages.libcxxStdenv.mkDerivation {
       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
       -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF \
       -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF \
-      -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON \
-      -DSANDBOX_SHELL=${pkgs.busybox}/bin/busybox
+      -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
   '';
 
   installCheckPhase = ''