diff --git a/command-not-found.sh b/command-not-found.sh index 5f30bad..3854297 100755 --- a/command-not-found.sh +++ b/command-not-found.sh @@ -73,51 +73,30 @@ EOF else if [ -e "$HOME/.nix-profile/manifest.json" ]; then >&2 cat <<EOF -The program '$cmd' is currently not installed. You can install it -by typing: - nix profile install $toplevel#$attrs - -Or run it once with: - nix shell $toplevel#$attrs -c $cmd ... +The program '$cmd' is not in your PATH. You can make it available in an +ephemeral shell by typing: + nix shell $toplevel#$attrs EOF else >&2 cat <<EOF -The program '$cmd' is currently not installed. You can install it -by typing: - nix-env -iA $toplevel.$attrs - -Or run it once with: - nix-shell -p $attrs --run '$cmd ...' +The program '$cmd' is not in your PATH. You can make it available in an +ephemeral shell by typing: + nix-shell -p $attrs EOF fi fi ;; *) >&2 cat <<EOF -The program '$cmd' is currently not installed. It is provided by -several packages. You can install it by typing one of the following: -EOF - - # ensure we get each element of attrs - # in a cross platform way - while read attr; do - if [ -e "$HOME/.nix-profile/manifest.json" ]; then - >&2 echo " nix profile install $toplevel#$attr" - else - >&2 echo " nix-env -iA $toplevel.$attr" - fi - done <<< "$attrs" - - >&2 cat <<EOF - -Or run it once with: +The program '$cmd' is not in your PATH. You can make it available in an +ephemeral shell by typing: EOF while read attr; do if [ -e "$HOME/.nix-profile/manifest.json" ]; then - >&2 echo " nix shell $toplevel#$attr -c $cmd ..." + >&2 echo " nix shell $toplevel#$attr" else - >&2 echo " nix-shell -p $attr --run '$cmd ...'" + >&2 echo " nix-shell -p $attr" fi done <<< "$attrs" ;;