2023-06-01 15:17:16 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, asciidoctor
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, ripgrep
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "repgrep";
|
2023-08-09 00:33:51 +00:00
|
|
|
version = "0.14.3";
|
2023-06-01 15:17:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "acheronfail";
|
|
|
|
repo = "repgrep";
|
|
|
|
rev = version;
|
2023-08-09 00:33:51 +00:00
|
|
|
hash = "sha256-33b0dZJY/lnVJGMfAg/faD6PPJIFZsvMZOmKAqCZw8k=";
|
2023-06-01 15:17:16 +00:00
|
|
|
};
|
|
|
|
|
2023-08-09 00:33:51 +00:00
|
|
|
cargoHash = "sha256-UMMTdWJ0/M8lN4abTJEVUGtoNp/g49DyW+OASg3TKfg=";
|
2023-06-01 15:17:16 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
asciidoctor
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/rgr \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ ripgrep ]}
|
|
|
|
|
|
|
|
pushd "$(dirname "$(find -path '**/repgrep-stamp' | head -n 1)")"
|
|
|
|
installManPage rgr.1
|
|
|
|
installShellCompletion rgr.{bash,fish} _rgr
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "An interactive replacer for ripgrep that makes it easy to find and replace across files on the command line";
|
|
|
|
homepage = "https://github.com/acheronfail/repgrep";
|
|
|
|
changelog = "https://github.com/acheronfail/repgrep/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = with licenses; [ mit asl20 unlicense ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2023-07-02 18:58:30 +00:00
|
|
|
mainProgram = "rgr";
|
2023-06-01 15:17:16 +00:00
|
|
|
};
|
|
|
|
}
|