command-not-found: Fix nix-env invocation

Changed files
+5 -5
nixos
modules
programs
+2 -2
nixos/modules/programs/command-not-found/command-not-found.nix
···
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
}
'';
+3 -3
nixos/modules/programs/command-not-found/command-not-found.pl
···
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 <<EOF;
The program ‘$program’ is currently not installed. You can install it by typing:
-
nix-env -iA $package
+
nix-env -iA nixos.$package
EOF
}
} else {
···
The program ‘$program’ is currently not installed. It is provided by
several packages. You can install it by typing one of the following:
EOF
-
print STDERR " nix-env -iA $_->{package}\n" foreach @$res;
+
print STDERR " nix-env -iA nixos.$_->{package}\n" foreach @$res;
}
exit 127;