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