diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d548a07be..c3b3bee54 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -587,3 +587,5 @@ Makefile @thiagokokada /modules/xresources.nix @rycee /modules/xsession.nix @rycee + +/modules/programs/hstr.nix @Dines97 diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 267a42a38..83acf9911 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -47,6 +47,12 @@ fingerprint = "4C92 E3B0 21B5 5562 A1E0 CE3D B1C0 12F0 E769 7195"; }]; }; + Dines97 = { + name = "Denis Kaynar"; + email = "19364873+Dines97@users.noreply.github.com"; + github = "Dines97"; + githubId = 19364873; + }; dwagenk = { email = "dwagenk@mailbox.org"; github = "dwagenk"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index f7c6a3386..c3335fcbe 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -972,6 +972,13 @@ in A new module is available: 'services.syncthing'. ''; } + + { + time = "2023-03-25T14:53:57+00:00"; + message = '' + A new module is available: 'programs.hstr'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 08b15699e..0e60bb59f 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -90,6 +90,7 @@ let ./programs/hexchat.nix ./programs/himalaya.nix ./programs/home-manager.nix + ./programs/hstr.nix ./programs/htop.nix ./programs/hyfetch.nix ./programs/i3status-rust.nix diff --git a/modules/programs/hstr.nix b/modules/programs/hstr.nix new file mode 100644 index 000000000..e85832174 --- /dev/null +++ b/modules/programs/hstr.nix @@ -0,0 +1,39 @@ +{ 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 = mkEnableOption "Bash integration" // { + default = true; + }; + + enableZshIntegration = mkEnableOption "Zsh integration" // { + 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)" + ''; + }; +}