mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
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.
24 lines
495 B
Nix
24 lines
495 B
Nix
{
|
|
flake,
|
|
fzf,
|
|
python3,
|
|
writeShellApplication,
|
|
}:
|
|
writeShellApplication {
|
|
name = "tests";
|
|
runtimeInputs = [
|
|
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 "$@"
|
|
'';
|
|
}
|