From 87044c57222fb485974062e2dd557e7b8abd8fff Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sat, 1 Nov 2025 10:40:46 +0000 Subject: [PATCH] tests: explicitly define NIX_CONFIG Ensure NIX_CONFIG is correctly configured for the tests command. It is possible that someone may enable experimental features on an ad-hoc basis, e.g. via the `--extra-experimental-features` CLI flag. In this scenario, the tests script cannot assume they are already enabled. In the future, we may also wish to configure other things, like extra binary substitutors. --- tests/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/package.nix b/tests/package.nix index e8e767ce5..1d50ab8d6 100644 --- a/tests/package.nix +++ b/tests/package.nix @@ -10,6 +10,14 @@ writeShellApplication { python3 fzf ]; + runtimeEnv = { + # Explicitly enable experimental features, in case someone runs e.g. + # nix run .#tests --extra-experimental-features 'nix-command flakes' + # without enabling them globally. + NIX_CONFIG = '' + experimental-features = nix-command flakes + ''; + }; text = '' exec python3 ${flake}/tests/tests.py "$@" '';