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