nixconfig/packages/vosk/default.nix
2023-11-08 17:15:32 +01:00

27 lines
715 B
Nix

{ lib, pkgs, stdenv, fetchurl, unzip }:
let
version = "0.3.45";
base = stdenv.mkDerivation {
name = "vosk-api";
version = "${version}";
src = fetchurl {
url =
"https://github.com/alphacep/vosk-api/releases/download/v${version}/vosk-linux-x86_64-${version}.zip";
sha256 = "sha256-u9yO2FxDl59kQxQoiXcOqVy/vFbP+1xdzXOvqHXF+7I=";
};
nativeBuildInputs = [ unzip ];
unpackCmd = "unzip $curSrc";
installPhase = ''
mkdir -p $out/lib
mv libvosk.so $out/lib/
mkdir -p $out/include
mv vosk_api.h $out/include/
'';
};
in {
default = (pkgs.callPackage base { });
cli = (pkgs.callPackage ./cli { });
lang = (pkgs.callPackage ./lang { });
}