Nix: Add nix_test.

This commit is contained in:
Dmitry Voronin 2024-10-24 16:14:34 +03:00
parent 150f1e096a
commit 83e8d165ea
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -66,5 +66,17 @@
function nix_local() { function nix_local() {
nix --option max-jobs $(_core_count) --builders "" --substituters https://cache.nixos.org ''${@} nix --option max-jobs $(_core_count) --builders "" --substituters https://cache.nixos.org ''${@}
} }
# Run test app from other people PRs.
# Usage: nix_test github:user/nixpkgs/<REV>#<PKG>
function nix_test() {
if [[ "''${@}" = "" ]]; then
help nix_test
return 2
fi
local name=''${*##*#}
SHELL_NAME="''${name}" NIXPKGS_ALLOW_UNFREE=1 nix --option max-jobs $(_core_count) --builders "" --substituters https://cache.nixos.org shell --impure ''${@}
}
''; '';
} }