2018-09-25 14:18:42 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
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 = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable autojump.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2020-08-07 13:43:58 +00:00
|
|
|
};
|
2018-09-25 14:18:42 +00:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
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";
|
2018-09-26 12:58:28 +00:00
|
|
|
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";
|
2018-09-25 14:18:42 +00:00
|
|
|
};
|
|
|
|
}
|