1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

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.
This commit is contained in:
Matt Sturgeon 2025-11-01 10:40:46 +00:00 committed by Austin Horstman
parent 7248450206
commit 87044c5722

View file

@ -10,6 +10,14 @@ writeShellApplication {
python3 python3
fzf 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 = '' text = ''
exec python3 ${flake}/tests/tests.py "$@" exec python3 ${flake}/tests/tests.py "$@"
''; '';