Skip to content

Commit

Permalink
arpk: init at 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Nov 10, 2024
1 parent e49bb4a commit fd20964
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions pkgs/by-name/arpk/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
fetchFromGitHub,
lib,
makeWrapper,
nodejs_22,
pnpm_9,
stdenvNoCC,
testers,
}:
let
pnpm = pnpm_9;
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "arpk";
version = "0.2.4";

src = fetchFromGitHub {
owner = "moeru-ai";
repo = "arpk";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-/3tPUwjzZ4U/1sRkMzppWVh26eQ7IAiVXXhho4rKYnw=";
};

nativeBuildInputs = [
nodejs_22
makeWrapper
pnpm.configHook
];

pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-T33el2V62BEgxtY9hXRCMdJdZWEYWm+x31bkylzPUzY=";
};

buildPhase = ''
runHook preBuild
pnpm build
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib/node_modules/arpk}
cp -r {dist,node_modules} $out/lib/node_modules/arpk
makeWrapper ${lib.getExe nodejs_22} $out/bin/arpk --add-flags $out/lib/node_modules/arpk/dist/index.js
runHook postInstall
'';

passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };

meta = {
description = "Ollama as your translator, with DeepLX-compatible API";
homepage = "https://github.com/moeru-ai/arpk";
# changelog = "https://github.com/moeru-ai/arpk/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
mainProgram = "arpk";
maintainers = with lib.maintainers; [ kwaa ];
platforms = nodejs_22.meta.platforms;
};
})

0 comments on commit fd20964

Please sign in to comment.