diff --git a/pkgs/by-name/hg/hgrep/package.nix b/pkgs/by-name/hg/hgrep/package.nix new file mode 100644 index 000000000000..c110c9814d37 --- /dev/null +++ b/pkgs/by-name/hg/hgrep/package.nix @@ -0,0 +1,40 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + versionCheckHook, + nix-update-script, +}: + +let + version = "0.3.8"; +in +rustPlatform.buildRustPackage { + pname = "hgrep"; + inherit version; + + src = fetchFromGitHub { + owner = "rhysd"; + repo = "hgrep"; + tag = "v${version}"; + hash = "sha256-GcV6tZLhAtBE0/husOqZ3Gib9nXXg7kcxrNp9IK0eTo="; + }; + + cargoHash = "sha256-NxfWY9OoMNASlWE48njuAdTI11JAV+rzjD0OU2cHLsc="; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Grep with human-friendly search results"; + homepage = "https://github.com/rhysd/hgrep"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ axka ]; + mainProgram = "hgrep"; + }; +}