New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autojump: new program.autojump.enable flag to automatically load autojump #47334
Conversation
The autojump plugin in oh-my-zsh assumes autojump.zsh resides in /run/current-system/sw/share/autojump/ but these links are not created by default. The new programs.autojump.enable option forces the creation of these links.
Should definitely go in 18.09 as well... |
Will do. It already works for fish, and I don’t think I did anything special on the fish side, but I can at least make sure it doesn’t break. |
It is unfortunate that bash support was broken in #40725 and this PR did not make it in to 18.09. It is also unfortunate that the autojump documentation in the nixpkgs manual was not updated. Any way to hurry this PR up and get it in to |
@xeji any hope to see this merged (and back ported to 18.09?) |
|
||
programs.bash.interactiveShellInit = "source ${pkgs.autojump}/share/autojump/autojump.bash"; | ||
programs.zsh.interactiveShellInit = mkIf prg.zsh.enable "source ${pkgs.autojump}/share/autojump/autojump.zsh"; | ||
programs.fish.interactiveShellInit = mkIf prg.fish.enable "source ${pkgs.autojump}/share/autojump/autojump.fish"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm this didn't break anything for me and my fish
, but I'm pretty sure this line is redunant and unnecessary. Maybe someone else can chime in.
Ideally these things wouldn't need a module at all. What happens when you just put |
@matthewbauer, I thought so too, but according to discussion on #40725, apparently not. It seems to me it might be preferable to address the root of the problem, at the bash/zsh level, rather than introduce modules like this one. But since I've not reproduced the problem myself, I'm not sure how to approach it. |
There are pros and cons for a module:
|
I didn't mean to advocate that we add special handling for autojump or individual plugins at the bash/zsh level, but rather we figure out why it's not picking up |
I think this might be nicer for some people, but I'd argue that it may be somewhat unintuitive. If I have the Originally, enabling This "opt-in" style for It'd also be great if this PR updated the nixpkgs manual with how to use autojump: https://nixos.org/nixpkgs/manual/#sec-shell-helpers I guess I should add that I am in favor of this current PR. It adds an easy way to get autojump added whenever anyone runs bash: However, this isn't really an option for people not on NixOS. |
This still doesn't make it easier for non-NixOS users, but at least gets NixOS users back on track. Backporting also to 18.09 |
Motivation for this change
The new programs.autojump.enable option forces the creation of links needed by the oh-my-zsh autojump plugin and automatically sources the necessary scripts in bash, zsh and fish. This also fixes problems due to the removal of autojump-share (#40725)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)