From 66d4a643b77375fab44537431d7cff54a38bf86e Mon Sep 17 00:00:00 2001 From: Adrien Lemaire Date: Sun, 12 Jan 2025 14:45:24 +0100 Subject: [PATCH] docs: add command_not_found hook for nixos (#1745) --- book/hooks.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/book/hooks.md b/book/hooks.md index 1210ada256..ab5ef2b0fd 100644 --- a/book/hooks.md +++ b/book/hooks.md @@ -297,6 +297,16 @@ $env.config = { } ``` +### `command_not_found` Hook in _NixOS_ + +NixOS comes with the command `command-not-found`. We only need to plug it in the nushell hook: + +```nu +$env.config.hooks.command_not_found = { + |command_name| + print (command-not-found $command_name | str trim) +} +``` ### `command_not_found` Hook in _Windows_