Skip to content

Commit 66d4a64

Browse files
docs: add command_not_found hook for nixos (nushell#1745)
1 parent a59f444 commit 66d4a64

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

book/hooks.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ $env.config = {
297297
}
298298
```
299299

300+
### `command_not_found` Hook in _NixOS_
301+
302+
NixOS comes with the command `command-not-found`. We only need to plug it in the nushell hook:
303+
304+
```nu
305+
$env.config.hooks.command_not_found = {
306+
|command_name|
307+
print (command-not-found $command_name | str trim)
308+
}
309+
```
300310

301311

302312
### `command_not_found` Hook in _Windows_

0 commit comments

Comments
 (0)