serpl: add ast-grep feature

This makes it possible to use serpl in "ast-grep" mode.
This commit is contained in:
Auguste Baum
2025-02-19 16:55:14 +01:00
parent ebba83e117
commit 9010d1b534
+9 -1
View File
@@ -4,6 +4,7 @@
fetchFromGitHub,
gitUpdater,
makeWrapper,
ast-grep,
ripgrep,
}:
let
@@ -19,6 +20,8 @@ rustPlatform.buildRustPackage {
hash = "sha256-koD5aFqL+XVxc5Iq3reTYIHiPm0z7hAQ4K59IfbY4Hg=";
};
buildFeatures = [ "ast_grep" ];
nativeBuildInputs = [ makeWrapper ];
cargoHash = "sha256-8XYEZQfoizVmOuh0hymzMj2UDiXNkSeHqBAWOqaMY84=";
@@ -26,7 +29,12 @@ rustPlatform.buildRustPackage {
postFixup = ''
# Serpl needs ripgrep to function properly.
wrapProgram $out/bin/serpl \
--prefix PATH : "${lib.strings.makeBinPath [ ripgrep ]}"
--prefix PATH : "${
lib.strings.makeBinPath [
ripgrep
ast-grep
]
}"
'';
passthru.updateScript = gitUpdater { };