This also deprecates the `programs.bash.enableAutojump` option in favor of this module.wip/yesman
parent
7e5fee4268
commit
8537920706
@ -0,0 +1,56 @@ |
||||
{ 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 |
||||
''; |
||||
}; |
||||
} |
@ -0,0 +1,13 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
{ |
||||
config = { |
||||
programs.autojump.enable = true; |
||||
|
||||
nmt.script = '' |
||||
assertFileExists home-path/bin/autojump |
||||
''; |
||||
}; |
||||
} |
@ -0,0 +1 @@ |
||||
{ autojump = ./default-settings.nix; } |
Loading…
Reference in new issue