Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
rustPlatform,
fetchFromGitHub,
nix-update-script,
makeWrapper,
ast-grep,
ripgrep,
versionCheckHook,
}:
let
pname = "serpl";
version = "0.3.4";
in
rustPlatform.buildRustPackage {
inherit pname version;
src = fetchFromGitHub {
owner = "yassinebridi";
repo = "serpl";
rev = version;
hash = "sha256-lEvUS1RlZ4CvervzyfODsFqRJAiA6PyLNUVWhSoPMDY=";
};
buildFeatures = [ "ast_grep" ];
nativeBuildInputs = [ makeWrapper ];
cargoHash = "sha256-reeJsSNifPeDzqMKVpS1Pmyn9x1F+Vin/xy81d5rKVs=";
postFixup = ''
# Serpl needs ripgrep to function properly.
wrapProgram $out/bin/serpl \
--prefix PATH : "${
lib.strings.makeBinPath [
ripgrep
ast-grep
]
}"
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/serpl";
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "Simple terminal UI for search and replace, ala VS Code";
homepage = "https://github.com/yassinebridi/serpl.git";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ NotAShelf ];
mainProgram = "serpl";
};
}