1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 18:29:39 +01:00
home-manager/modules/programs/hstr.nix
Austin Horstman 10deb9d043 treewide: zsh initExtra -> initContent
Migrating in tree usages of zsh initExtra to initContent before
deprecating.
2025-03-22 13:46:42 -05:00

37 lines
891 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.hstr;
in {
meta.maintainers = [ hm.maintainers.Dines97 ];
options.programs.hstr = {
enable = mkEnableOption ''
Bash And Zsh shell history suggest box - easily view, navigate, search and
manage your command history'';
package = mkPackageOption pkgs "hstr" { };
enableBashIntegration =
lib.hm.shell.mkBashIntegrationOption { inherit config; };
enableZshIntegration =
lib.hm.shell.mkZshIntegrationOption { inherit config; };
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
eval "$(${cfg.package}/bin/hstr --show-configuration)"
'';
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/hstr --show-zsh-configuration)"
'';
};
}