···3use strict;
4use DBI;
5use DBD::SQLite;
06use Config;
78my $program = $ARGV[0];
···31EOF
32 ;
33 exit 126 if system("nix-env", "-iA", "nixos.$package") == 0;
0034 } else {
35 print STDERR <<EOF;
36The program ‘$program’ is currently not installed. You can install it by typing:
···3use strict;
4use DBI;
5use DBD::SQLite;
6+use String::ShellQuote;
7use Config;
89my $program = $ARGV[0];
···32EOF
33 ;
34 exit 126 if system("nix-env", "-iA", "nixos.$package") == 0;
35+ } elsif ($ENV{"NIX_AUTO_RUN"} // "") {
36+ exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV));
37 } else {
38 print STDERR <<EOF;
39The program ‘$program’ is currently not installed. You can install it by typing: