2020-09-18 15:07:40 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.autojump;
|
|
|
|
package = pkgs.autojump;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.evanjs ];
|
|
|
|
|
|
|
|
options.programs.autojump = {
|
|
|
|
enable = mkEnableOption "autojump";
|
|
|
|
|
|
|
|
enableBashIntegration = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Bash integration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
enableZshIntegration = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Zsh integration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
enableFishIntegration = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Fish integration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ package ];
|
|
|
|
|
|
|
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkBefore ''
|
|
|
|
. ${package}/share/autojump/autojump.bash
|
|
|
|
'');
|
|
|
|
|
|
|
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
|
|
|
. ${package}/share/autojump/autojump.zsh
|
|
|
|
'';
|
|
|
|
|
2021-10-28 00:40:39 +02:00
|
|
|
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
2020-09-18 15:07:40 +02:00
|
|
|
. ${package}/share/autojump/autojump.fish
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|