2018-09-25 17:18:42 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.autojump;
|
2018-09-26 15:58:28 +03:00
|
|
|
prg = config.programs;
|
2018-09-25 17:18:42 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.autojump = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable autojump.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2020-08-07 16:43:58 +03:00
|
|
|
};
|
2018-09-25 17:18:42 +03:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.pathsToLink = [ "/share/autojump" ];
|
2018-09-25 21:16:11 +03:00
|
|
|
environment.systemPackages = [ pkgs.autojump ];
|
2018-09-26 15:58:28 +03:00
|
|
|
|
2020-08-07 16:43:58 +03:00
|
|
|
programs.bash.interactiveShellInit = "source ${pkgs.autojump}/share/autojump/autojump.bash";
|
2018-09-26 15:58:28 +03: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 17:18:42 +03:00
|
|
|
};
|
|
|
|
}
|