From 91fa73c0a8acccc62cfb136b48a3a35de6dbeacb Mon Sep 17 00:00:00 2001 From: airRnot1106 Date: Wed, 25 Jun 2025 23:31:28 +0900 Subject: [PATCH] similarity: init at 0.2.4 --- pkgs/by-name/si/similarity/package.nix | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pkgs/by-name/si/similarity/package.nix diff --git a/pkgs/by-name/si/similarity/package.nix b/pkgs/by-name/si/similarity/package.nix new file mode 100644 index 000000000000..c10e5dfc9279 --- /dev/null +++ b/pkgs/by-name/si/similarity/package.nix @@ -0,0 +1,36 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + versionCheckHook, + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "similarity"; + version = "0.2.4"; + + src = fetchFromGitHub { + owner = "mizchi"; + repo = "similarity"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Z2ZaKBpq7N8KIX8nOzPhm8evfoUxBzaAK0+4cU9qBDE="; + }; + + cargoHash = "sha256-oYqdCHGY6OZSbYXhjIt20ZL2JkZP7UEOhn0fhuZQnZo="; + + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.pname}-ts"; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Code similarity detection tool"; + homepage = "https://github.com/mizchi/similarity"; + changelog = "https://github.com/mizchi/similarity/blob/v${finalAttrs.version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ airrnot ]; + }; +})