From 83e8d165eaf7dd304a31e2d1036418568f2a693b Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 24 Oct 2024 16:14:34 +0300 Subject: [PATCH] Nix: Add nix_test. --- home/program/bash/module/Nix.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/program/bash/module/Nix.nix b/home/program/bash/module/Nix.nix index 5d00c7a0..80d255da 100644 --- a/home/program/bash/module/Nix.nix +++ b/home/program/bash/module/Nix.nix @@ -66,5 +66,17 @@ function nix_local() { 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/# + 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 ''${@} + } ''; }