@@ -26,6 +26,17 @@ if (!defined $res || scalar @$res == 0) {
2626} elsif (scalar @$res == 1) {
2727 my $package = @$res[0]->{package};
2828 if ($ENV{"NIX_AUTO_RUN"} // "") {
29+ if ($ENV{"NIX_AUTO_RUN_INTERACTIVE"} // "") {
30+ while (1) {
31+ print STDERR "'$program' from package '$package' will be run, confirm? [yn]: ";
32+ chomp(my $comfirm = <STDIN>);
33+ if (lc $comfirm eq "n") {
34+ exit 0;
35+ } elsif (lc $comfirm eq "y") {
36+ last;
37+ }
38+ }
39+ }
2940 exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV));
3041 } else {
3142 print STDERR <<EOF;