diff --git a/flake.nix b/flake.nix index 7b3375a..b806007 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,10 @@ wrapProgram $out/bin/comma \ --prefix PATH : ${lib.makeBinPath (with pkgs; [ nix fzy nix-index-unwrapped ])} ln -s $out/bin/comma $out/bin/, + + mkdir -p $out/etc/profile.d + cp $src/src/command-not-found.sh $out/etc/profile.d + patchShebangs $out/etc/profile.d/command-not-found.sh ''; }; checkInputs = [ pkgs.rustPackages.clippy ]; diff --git a/src/command-not-found.sh b/src/command-not-found.sh new file mode 100755 index 0000000..96791c4 --- /dev/null +++ b/src/command-not-found.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# bash command not found handler +command_not_found_handle() { + ../../bin/comma "$@" + return $? +} + +# zsh compatibility +command_not_found_handler () { + command_not_found_handle "$@" + return $? +}