summary refs log tree commit diff
path: root/lib/path
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-08-11 17:08:16 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-08-11 17:08:16 +0200
commitb8435108e1a4f3292e6631dbd8134810db1bec76 (patch)
treeff8c70174c18cf47f2467476119784fd4b9131be /lib/path
parent29717e5bdf90c38f6b5ee6cfeba38cccab154047 (diff)
downloadnixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.tar
nixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.tar.gz
nixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.tar.bz2
nixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.tar.lz
nixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.tar.xz
nixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.tar.zst
nixpkgs-b8435108e1a4f3292e6631dbd8134810db1bec76.zip
lib/path/tests: Fix test setup on darwin
These statements are taken from the `lib/test/release.nix` tests,
which previously also worked on darwin.

Unblocks https://github.com/NixOS/nix/pull/8569 when backported
Diffstat (limited to 'lib/path')
-rw-r--r--lib/path/tests/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/path/tests/default.nix b/lib/path/tests/default.nix
index 6b8e515f433..50d40cdfa47 100644
--- a/lib/path/tests/default.nix
+++ b/lib/path/tests/default.nix
@@ -18,7 +18,14 @@ pkgs.runCommand "lib-path-tests" {
   ];
 } ''
   # Needed to make Nix evaluation work
-  export NIX_STATE_DIR=$(mktemp -d)
+  export TEST_ROOT=$(pwd)/test-tmp
+  export NIX_BUILD_HOOK=
+  export NIX_CONF_DIR=$TEST_ROOT/etc
+  export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
+  export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
+  export NIX_STATE_DIR=$TEST_ROOT/var/nix
+  export NIX_STORE_DIR=$TEST_ROOT/store
+  export PAGER=cat
 
   cp -r ${libpath} lib
   export TEST_LIB=$PWD/lib