0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

command-not-found: add support for NixOS (#7701)

This commit is contained in:
SomeDer 2019-03-25 21:19:46 +00:00 committed by Marc Cornellà
parent 1e7033d660
commit d79415b17d
2 changed files with 8 additions and 0 deletions

View file

@ -27,5 +27,6 @@ It works out of the box with the command-not-found packages for:
- [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found)
- [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found)
- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound)
- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found)
You can add support for other platforms by submitting a Pull Request.

View file

@ -31,3 +31,10 @@ if type brew &> /dev/null; then
eval "$(brew command-not-found-init)";
fi
fi
# NixOS command-not-found support
if [ -x /run/current-system/sw/bin/command-not-found ]; then
command_not_found_handler () {
/run/current-system/sw/bin/command-not-found $@
}
fi