2023-01-16 14:53:49 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.hstr;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ hm.maintainers.Dines97 ];
|
|
|
|
|
|
|
|
options.programs.hstr = {
|
2023-07-01 01:30:13 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc ''
|
2023-01-16 14:53:49 +01:00
|
|
|
Bash And Zsh shell history suggest box - easily view, navigate, search and
|
2023-07-01 01:30:13 +02:00
|
|
|
manage your command history'');
|
2023-01-16 14:53:49 +01:00
|
|
|
|
2023-07-01 11:41:32 +02:00
|
|
|
package = mkPackageOptionMD pkgs "hstr" { };
|
2023-01-16 14:53:49 +01:00
|
|
|
|
2023-07-01 01:30:13 +02:00
|
|
|
enableBashIntegration = mkEnableOption (lib.mdDoc "Bash integration") // {
|
2023-01-16 14:53:49 +01:00
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
2023-07-01 01:30:13 +02:00
|
|
|
enableZshIntegration = mkEnableOption (lib.mdDoc "Zsh integration") // {
|
2023-01-16 14:53:49 +01:00
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
|
|
|
eval "$(${cfg.package}/bin/hstr --show-configuration)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
|
|
|
eval "$(${cfg.package}/bin/hstr --show-zsh-configuration)"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|