mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
command-not-found: add xonsh integration
This commit is contained in:
parent
3e1b8d8251
commit
0d1ef2568d
1 changed files with 10 additions and 0 deletions
|
@ -48,6 +48,16 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.bash.initExtra = shInit "command_not_found_handle";
|
programs.bash.initExtra = shInit "command_not_found_handle";
|
||||||
programs.zsh.initExtra = shInit "command_not_found_handler";
|
programs.zsh.initExtra = shInit "command_not_found_handler";
|
||||||
|
programs.xonsh.xonshrc = ''
|
||||||
|
@events.on_command_not_found
|
||||||
|
def _command_not_found_nix(cmd):
|
||||||
|
import os.path
|
||||||
|
if os.path.isfile(${builtins.toJSON cfg.dbPath}):
|
||||||
|
${commandNotFound}/bin/command-not-found @(cmd)
|
||||||
|
else:
|
||||||
|
echo "$1: command not found" >&2
|
||||||
|
return 127
|
||||||
|
'';
|
||||||
|
|
||||||
home.packages = [ commandNotFound ];
|
home.packages = [ commandNotFound ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue