1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.programs.autojump;
7 prg = config.programs;
8in
9{
10 options = {
11 programs.autojump = {
12
13 enable = mkOption {
14 type = types.bool;
15 default = false;
16 description = lib.mdDoc ''
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}