mirror of
https://github.com/nix-community/home-manager
synced 2024-11-01 00:39:45 +01:00
8537920706
This also deprecates the `programs.bash.enableAutojump` option in favor of this module.
56 lines
1.2 KiB
Nix
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.promptInit = mkIf cfg.enableFishIntegration ''
|
|
. ${package}/share/autojump/autojump.fish
|
|
'';
|
|
};
|
|
}
|