hstr: add module

This commit is contained in:
Denis Kaynar 2023-01-16 16:53:49 +03:00 committed by Robert Helgesson
parent 3ace6a31dd
commit 99680311f1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
5 changed files with 55 additions and 0 deletions

2
.github/CODEOWNERS vendored
View file

@ -587,3 +587,5 @@ Makefile @thiagokokada
/modules/xresources.nix @rycee /modules/xresources.nix @rycee
/modules/xsession.nix @rycee /modules/xsession.nix @rycee
/modules/programs/hstr.nix @Dines97

View file

@ -47,6 +47,12 @@
fingerprint = "4C92 E3B0 21B5 5562 A1E0 CE3D B1C0 12F0 E769 7195"; 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 = { dwagenk = {
email = "dwagenk@mailbox.org"; email = "dwagenk@mailbox.org";
github = "dwagenk"; github = "dwagenk";

View file

@ -972,6 +972,13 @@ in
A new module is available: 'services.syncthing'. A new module is available: 'services.syncthing'.
''; '';
} }
{
time = "2023-03-25T14:53:57+00:00";
message = ''
A new module is available: 'programs.hstr'.
'';
}
]; ];
}; };
} }

View file

@ -90,6 +90,7 @@ let
./programs/hexchat.nix ./programs/hexchat.nix
./programs/himalaya.nix ./programs/himalaya.nix
./programs/home-manager.nix ./programs/home-manager.nix
./programs/hstr.nix
./programs/htop.nix ./programs/htop.nix
./programs/hyfetch.nix ./programs/hyfetch.nix
./programs/i3status-rust.nix ./programs/i3status-rust.nix

39
modules/programs/hstr.nix Normal file
View file

@ -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)"
'';
};
}