1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/package.nix
Matt Sturgeon 87044c5722 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.
2025-11-01 14:29:06 -05:00

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 "$@"
'';
}