nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # optional-dependencies
10 flask,
11 swagger-ui-py,
12 zeroconf,
13
14 # tests
15 pytest-asyncio,
16 pytestCheckHook,
17 wyoming-faster-whisper,
18 wyoming-openwakeword,
19 wyoming-piper,
20}:
21
22buildPythonPackage rec {
23 pname = "wyoming";
24 version = "1.8.0";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "OHF-Voice";
29 repo = "wyoming";
30 tag = "v${version}";
31 hash = "sha256-s1wYGqoTIsKj3u99/9KdKZmzUGzGeYq1TJHOkOVwkHQ=";
32 };
33
34 build-system = [ setuptools ];
35
36 optional-dependencies = {
37 http = [
38 flask
39 swagger-ui-py
40 ]
41 ++ flask.optional-dependencies.async;
42 zeroconf = [ zeroconf ];
43 };
44
45 pythonImportsCheck = [ "wyoming" ];
46
47 nativeCheckInputs = [
48 pytest-asyncio
49 pytestCheckHook
50 ]
51 ++ lib.concatAttrValues optional-dependencies;
52
53 passthru.tests = {
54 inherit wyoming-faster-whisper wyoming-openwakeword wyoming-piper;
55 };
56
57 meta = {
58 changelog = "https://github.com/OHF-Voice/wyoming/releases/tag/${src.tag}";
59 description = "Protocol for Rhasspy Voice Assistant";
60 homepage = "https://github.com/OHF-Voice/wyoming";
61 license = lib.licenses.mit;
62 maintainers = with lib.maintainers; [ hexa ];
63 };
64}