diff --git a/nixos/modules/programs/command-not-found/command-not-found.nix b/nixos/modules/programs/command-not-found/command-not-found.nix index bead2dcdcf9..9524d91ea3b 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.nix +++ b/nixos/modules/programs/command-not-found/command-not-found.nix @@ -57,9 +57,9 @@ in if [ $? = 126 ]; then "$@" fi - else + else # Indicate than there was an error so ZSH falls back to its default handler - return 127 + return 127 fi } ''; diff --git a/nixos/modules/programs/command-not-found/command-not-found.pl b/nixos/modules/programs/command-not-found/command-not-found.pl index 621b79d1654..b233d973a4a 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.pl +++ b/nixos/modules/programs/command-not-found/command-not-found.pl @@ -30,11 +30,11 @@ The program ‘$program’ is currently not installed. It is provided by the package ‘$package’, which I will now install for you. EOF ; - exit 126 if system("nix-env", "-iA", $package) == 0; + exit 126 if system("nix-env", "-iA", "nixos.$package") == 0; } else { print STDERR <{package}\n" foreach @$res; + print STDERR " nix-env -iA nixos.$_->{package}\n" foreach @$res; } exit 127;