Merge pull request #264404 from mweinelt/wyoming-openwakeword-1.8.1

wyoming-openwakeword: 1.5.1 -> 1.8.1

authored by

Martin Weinelt and committed by
GitHub
5da8c00f 63982e51

+39 -41
+27 -19
nixos/modules/services/audio/wyoming/openwakeword.nix
··· 8 cfg = config.services.wyoming.openwakeword; 9 10 inherit (lib) 11 concatMapStringsSep 12 escapeShellArgs 13 mkOption ··· 15 mkEnableOption 16 mkIf 17 mkPackageOptionMD 18 types 19 ; 20 ··· 25 in 26 27 { 28 meta.buildDocsInSandbox = false; 29 30 options.services.wyoming.openwakeword = with types; { ··· 41 ''; 42 }; 43 44 - models = mkOption { 45 type = listOf str; 46 default = [ 47 # wyoming_openwakeword/models/*.tflite 48 "alexa" 49 "hey_jarvis" ··· 52 "ok_nabu" 53 ]; 54 description = mdDoc '' 55 - List of wake word models that should be made available. 56 - ''; 57 - }; 58 - 59 - preloadModels = mkOption { 60 - type = listOf str; 61 - default = [ 62 - "ok_nabu" 63 - ]; 64 - description = mdDoc '' 65 List of wake word models to preload after startup. 66 ''; 67 }; ··· 112 DynamicUser = true; 113 User = "wyoming-openwakeword"; 114 # https://github.com/home-assistant/addons/blob/master/openwakeword/rootfs/etc/s6-overlay/s6-rc.d/openwakeword/run 115 - ExecStart = '' 116 - ${cfg.package}/bin/wyoming-openwakeword \ 117 - --uri ${cfg.uri} \ 118 - ${concatMapStringsSep " " (model: "--model ${model}") cfg.models} \ 119 - ${concatMapStringsSep " " (model: "--preload-model ${model}") cfg.preloadModels} \ 120 - --threshold ${cfg.threshold} \ 121 - --trigger-level ${cfg.triggerLevel} ${cfg.extraArgs} 122 - ''; 123 CapabilityBoundingSet = ""; 124 DeviceAllow = ""; 125 DevicePolicy = "closed";
··· 8 cfg = config.services.wyoming.openwakeword; 9 10 inherit (lib) 11 + concatStringsSep 12 concatMapStringsSep 13 escapeShellArgs 14 mkOption ··· 16 mkEnableOption 17 mkIf 18 mkPackageOptionMD 19 + mkRemovedOptionModule 20 types 21 ; 22 ··· 27 in 28 29 { 30 + imports = [ 31 + (mkRemovedOptionModule [ "services" "wyoming" "openwakeword" "models" ] "Configuring models has been removed, they are now dynamically discovered and loaded at runtime") 32 + ]; 33 + 34 meta.buildDocsInSandbox = false; 35 36 options.services.wyoming.openwakeword = with types; { ··· 47 ''; 48 }; 49 50 + customModelsDirectories = mkOption { 51 + type = listOf types.path; 52 + default = []; 53 + description = lib.mdDoc '' 54 + Paths to directories with custom wake word models (*.tflite model files). 55 + ''; 56 + }; 57 + 58 + preloadModels = mkOption { 59 type = listOf str; 60 default = [ 61 + "ok_nabu" 62 + ]; 63 + example = [ 64 # wyoming_openwakeword/models/*.tflite 65 "alexa" 66 "hey_jarvis" ··· 69 "ok_nabu" 70 ]; 71 description = mdDoc '' 72 List of wake word models to preload after startup. 73 ''; 74 }; ··· 119 DynamicUser = true; 120 User = "wyoming-openwakeword"; 121 # https://github.com/home-assistant/addons/blob/master/openwakeword/rootfs/etc/s6-overlay/s6-rc.d/openwakeword/run 122 + ExecStart = concatStringsSep " " [ 123 + "${cfg.package}/bin/wyoming-openwakeword" 124 + "--uri ${cfg.uri}" 125 + (concatMapStringsSep " " (model: "--preload-model ${model}") cfg.preloadModels) 126 + (concatMapStringsSep " " (dir: "--custom-model-dir ${toString dir}") cfg.customModelDirectories) 127 + "--threshold ${cfg.threshold}" 128 + "--trigger-level ${cfg.triggerLevel}" 129 + "${cfg.extraArgs}" 130 + ]; 131 CapabilityBoundingSet = ""; 132 DeviceAllow = ""; 133 DevicePolicy = "closed";
+12 -22
pkgs/tools/audio/wyoming/openwakeword.nix
··· 1 { lib 2 - , python3 3 , python3Packages 4 , fetchFromGitHub 5 , fetchpatch 6 }: 7 8 - python3.pkgs.buildPythonApplication { 9 pname = "wyoming-openwakeword"; 10 - version = "1.5.1"; 11 pyproject = true; 12 13 src = fetchFromGitHub { 14 owner = "rhasspy"; 15 - repo = "rhasspy3"; 16 - rev = "e16d7d374a64f671db48142c7b635b327660ebcf"; 17 - hash = "sha256-SbWsRmR1hfuU3yJbuu+r7M43ugHeNwLgu5S8MqkbCQA="; 18 }; 19 20 patches = [ 21 (fetchpatch { 22 # import tflite entrypoint from tensorflow 23 - url = "https://github.com/rhasspy/rhasspy3/commit/23b1bc9cf1e9aa78453feb11e27d5dafe26de068.patch"; 24 - hash = "sha256-fjLJ+VI4c8ABBWx1IjZ6nS8MGqdry4rgcThKiaAvz+Q="; 25 }) 26 (fetchpatch { 27 # add commandline entrypoint 28 - url = "https://github.com/rhasspy/rhasspy3/commit/7662b82cd85e16817a3c6f4153e855bf57436ac3.patch"; 29 - hash = "sha256-41CLkVDSAJJpZ5irwIf/Z4wHoCuKDrqFBAjKCx7ta50="; 30 }) 31 ]; 32 33 - postPatch = '' 34 - cd programs/wake/openwakeword-lite/server 35 - ''; 36 - 37 nativeBuildInputs = with python3Packages; [ 38 setuptools 39 - wheel 40 ]; 41 42 propagatedBuildInputs = with python3Packages; [ 43 - tensorflow-bin 44 - webrtc-noise-gain 45 wyoming 46 ]; 47 48 - passthru.optional-dependencies.webrtc = with python3Packages; [ 49 - webrtc-noise-gain 50 - ]; 51 - 52 pythonImportsCheck = [ 53 "wyoming_openwakeword" 54 ]; 55 56 meta = with lib; { 57 description = "An open source voice assistant toolkit for many human languages"; 58 - homepage = "https://github.com/rhasspy/rhasspy3/commit/fe44635132079db74d0c76c6b3553b842aa1e318"; 59 license = licenses.mit; 60 maintainers = with maintainers; [ hexa ]; 61 mainProgram = "wyoming-openwakeword";
··· 1 { lib 2 , python3Packages 3 , fetchFromGitHub 4 , fetchpatch 5 }: 6 7 + python3Packages.buildPythonApplication rec { 8 pname = "wyoming-openwakeword"; 9 + version = "1.8.1"; 10 pyproject = true; 11 12 src = fetchFromGitHub { 13 owner = "rhasspy"; 14 + repo = "wyoming-openwakeword"; 15 + rev = "refs/tags/v${version}"; 16 + hash = "sha256-N/EjdNQLsYLpJ4kOxY/z+/dMMmF1PPAIEEzSHfnZWaM="; 17 }; 18 19 patches = [ 20 (fetchpatch { 21 # import tflite entrypoint from tensorflow 22 + url = "https://github.com/rhasspy/wyoming-openwakeword/commit/8f4ba2750d8c545e77549a7230cdee1301dac09a.patch"; 23 + hash = "sha256-WPvywpGv0sYYVGc7he4bt7APIsa3ziKaWqpFlx3v+V8="; 24 }) 25 (fetchpatch { 26 # add commandline entrypoint 27 + url = "https://github.com/rhasspy/wyoming-openwakeword/commit/f40e5635543b2315217538dd89a9fe40fe817cfe.patch"; 28 + hash = "sha256-HNlGqt7bMzwyvhx5Hw7mkTHeQmBpgDCU3pUbZzss1bY="; 29 }) 30 ]; 31 32 nativeBuildInputs = with python3Packages; [ 33 setuptools 34 ]; 35 36 propagatedBuildInputs = with python3Packages; [ 37 + tensorflow 38 wyoming 39 ]; 40 41 pythonImportsCheck = [ 42 "wyoming_openwakeword" 43 ]; 44 45 meta = with lib; { 46 + changelog = "https://github.com/rhasspy/wyoming-openwakeword/blob/v${version}/CHANGELOG.md"; 47 description = "An open source voice assistant toolkit for many human languages"; 48 + homepage = "https://github.com/rhasspy/wyoming-openwakeword"; 49 license = licenses.mit; 50 maintainers = with maintainers; [ hexa ]; 51 mainProgram = "wyoming-openwakeword";