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