about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-17T22·05-0400
committerglittershark <grfn@gws.fyi>2020-07-18T00·03+0000
commitbe6fe93dd4cdf4583e615c412100b0ec0fc0b64d (patch)
tree915210f43316a8c06db45f3d0aca84ae1a44e287
parentf4f72bcf21127a1f75baa988b765317e80a7486e (diff)
feat(3p/nix): Add NIX_DATA_DIR to shell hook r/1370
all of the executables that get built during regular development depend
on this being set to a directory that contains the nix directory -
previously we had been doing it manually every time, this automates it.

Change-Id: I4c957c0abf0a92ca7122a47d3b141a8ede280e13
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1258
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
-rw-r--r--third_party/nix/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix
index ad1ff5beeb..b4f16d02c7 100644
--- a/third_party/nix/default.nix
+++ b/third_party/nix/default.nix
@@ -1,5 +1,8 @@
 { pkgs ? (import ../.. {}).third_party
-, buildType ? "release", ... }:
+, buildType ? "release"
+, depotPath ? ../..
+, ...
+}:
 
 let
   aws-s3-cpp = pkgs.aws-sdk-cpp.override {
@@ -115,6 +118,10 @@ in pkgs.llvmPackages.libcxxStdenv.mkDerivation {
     ln -s $out/bin/nix $out/libexec/nix/build-remote
   '';
 
+  shellHook = ''
+    export NIX_DATA_DIR="${toString depotPath}/third_party"
+  '';
+
   # TODO(tazjin): integration test setup?
   # TODO(tazjin): docs generation?
 }