@@ -0,0 +1,33 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ cfg = config.programs.autojump;
7+ prg = config.programs;
8+in
9+{
10+ options = {
11+ programs.autojump = {
12+
13+ enable = mkOption {
14+ type = types.bool;
15+ default = false;
16+ description = ''
17+ Whether to enable autojump.
18+ '';
19+ };
20+ };
21+ };
22+
23+ ###### implementation
24+
25+ config = mkIf cfg.enable {
26+ environment.pathsToLink = [ "/share/autojump" ];
27+ environment.systemPackages = [ pkgs.autojump ];
28+
29+ programs.bash.interactiveShellInit = "source ${pkgs.autojump}/share/autojump/autojump.bash";
30+ programs.zsh.interactiveShellInit = mkIf prg.zsh.enable "source ${pkgs.autojump}/share/autojump/autojump.zsh";
31+ programs.fish.interactiveShellInit = mkIf prg.fish.enable "source ${pkgs.autojump}/share/autojump/autojump.fish";
32+ };
33+}