Commit 24db1431 authored by Philipp Riederer's avatar Philipp Riederer
Browse files

okapi-ed: init at 0.4.1

parent 8e302268
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  makeBinaryWrapper,
  ripgrep,
  rustPlatform,
  versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
  __structuredAttrs = true;

  pname = "okapi-ed";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "nk9";
    repo = "okapi";
    tag = "v${finalAttrs.version}";
    hash = "sha256-Xnckb3CMB8lE1oaEbmy8etRGJB5BuSoHts0phXm48uM=";
  };

  cargoHash = "sha256-g+JbSph5Fplq7SYKnWUpMQdoT989+qOe+kRUK3K+bDk=";

  nativeBuildInputs = [ makeBinaryWrapper ];

  postFixup = ''
    wrapProgram "$out/bin/okapi" \
      --prefix PATH : "${lib.makeBinPath [ ripgrep ]}"
  '';

  nativeInstallCheckInputs = [ versionCheckHook ];
  doInstallCheck = true;

  meta = {
    description = "Find lines across files by regex and edit them all at once with your $EDITOR";
    homepage = "https://github.com/nk9/okapi";
    license = lib.licenses.asl20;
    mainProgram = "okapi";
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ toelke ];
  };
})