1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-15 17:50:53 +00:00
home-manager/modules/programs/autojump.nix
Kid 9282dbc1fa
fish: remove promptInit in favor of interactiveShellInit (#2231)
* fish: remove `promptInit` in favor of `interactiveShellInit`

* Oops

* starship: replace `promptInit` with `interactiveShellInit`

* autojump: replace `promptInit` with `interactiveShellInit`

* Add `mkRemovedOptionModule` for `programs.fish.promptInit`
2021-10-27 16:40:39 -06:00

56 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.autojump;
package = pkgs.autojump;
in {
meta.maintainers = [ maintainers.evanjs ];
options.programs.autojump = {
enable = mkEnableOption "autojump";
enableBashIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Bash integration.
'';
};
enableZshIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Zsh integration.
'';
};
enableFishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Fish integration.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ package ];
programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkBefore ''
. ${package}/share/autojump/autojump.bash
'');
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
. ${package}/share/autojump/autojump.zsh
'';
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
. ${package}/share/autojump/autojump.fish
'';
};
}