2018-09-25 14:18:42 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.autojump;
|
2018-09-26 12:58:28 +00:00
|
|
|
prg = config.programs;
|
2018-09-25 14:18:42 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.autojump = {
|
|
|
|
|
2024-04-17 11:37:58 +00:00
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2018-09-25 14:18:42 +00:00
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable autojump.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2020-08-07 13:43:58 +00:00
|
|
|
};
|
2018-09-25 14:18:42 +00:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2024-04-17 11:37:58 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2018-09-25 14:18:42 +00:00
|
|
|
environment.pathsToLink = [ "/share/autojump" ];
|
2018-09-25 18:16:11 +00:00
|
|
|
environment.systemPackages = [ pkgs.autojump ];
|
2018-09-26 12:58:28 +00:00
|
|
|
|
2020-08-07 13:43:58 +00:00
|
|
|
programs.bash.interactiveShellInit = "source ${pkgs.autojump}/share/autojump/autojump.bash";
|
2024-04-17 11:37:58 +00:00
|
|
|
programs.zsh.interactiveShellInit = lib.mkIf prg.zsh.enable "source ${pkgs.autojump}/share/autojump/autojump.zsh";
|
|
|
|
programs.fish.interactiveShellInit = lib.mkIf prg.fish.enable "source ${pkgs.autojump}/share/autojump/autojump.fish";
|
2018-09-25 14:18:42 +00:00
|
|
|
};
|
|
|
|
}
|