add voice option to home-assistant
This commit is contained in:
parent
796fdeaad3
commit
a8b29b243c
2 changed files with 100 additions and 0 deletions
|
|
@ -139,6 +139,42 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
voice = lib.mkOption {
|
||||
description = "Options related to voice service.";
|
||||
default = {};
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
speech-to-text = lib.mkOption {
|
||||
description = ''
|
||||
Wyoming piper servers.
|
||||
|
||||
https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.wyoming.piper.servers
|
||||
'';
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = {};
|
||||
};
|
||||
text-to-speech = lib.mkOption {
|
||||
description = ''
|
||||
Wyoming faster-whisper servers.
|
||||
|
||||
https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.wyoming.faster-whisper.servers
|
||||
'';
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = {};
|
||||
};
|
||||
wakeword = lib.mkOption {
|
||||
description = ''
|
||||
Wyoming open wakework servers.
|
||||
|
||||
https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.wyoming.openwakeword
|
||||
'';
|
||||
type = lib.types.anything;
|
||||
default = { enable = false; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
backup = lib.mkOption {
|
||||
description = ''
|
||||
Backup configuration.
|
||||
|
|
@ -267,6 +303,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
services.wyoming.piper.servers = cfg.voice.text-to-speech;
|
||||
services.wyoming.faster-whisper.servers = cfg.voice.speech-to-text;
|
||||
services.wyoming.openwakeword = cfg.voice.wakeword;
|
||||
|
||||
services.nginx.virtualHosts."${fqdn}" = {
|
||||
http2 = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,50 @@ let
|
|||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
voice = {
|
||||
shb.home-assistant.voice.text-to-speech = {
|
||||
"fr" = {
|
||||
enable = true;
|
||||
voice = "fr-siwis-medium";
|
||||
uri = "tcp://0.0.0.0:10200";
|
||||
speaker = 0;
|
||||
};
|
||||
"en" = {
|
||||
enable = true;
|
||||
voice = "en_GB-alba-medium";
|
||||
uri = "tcp://0.0.0.0:10201";
|
||||
speaker = 0;
|
||||
};
|
||||
};
|
||||
shb.home-assistant.voice.speech-to-text = {
|
||||
"tiny-fr" = {
|
||||
enable = true;
|
||||
model = "base-int8";
|
||||
language = "fr";
|
||||
uri = "tcp://0.0.0.0:10300";
|
||||
device = "cpu";
|
||||
};
|
||||
"tiny-en" = {
|
||||
enable = true;
|
||||
model = "base-int8";
|
||||
language = "en";
|
||||
uri = "tcp://0.0.0.0:10301";
|
||||
device = "cpu";
|
||||
};
|
||||
};
|
||||
shb.home-assistant.voice.wakeword = {
|
||||
enable = true;
|
||||
uri = "tcp://127.0.0.1:10400";
|
||||
preloadModels = [
|
||||
"alexa"
|
||||
"hey_jarvis"
|
||||
"hey_mycroft"
|
||||
"hey_rhasspy"
|
||||
"ok_nabu"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
basic = pkgs.testers.runNixOSTest {
|
||||
|
|
@ -151,4 +195,20 @@ in
|
|||
#
|
||||
# testScript = commonTestScript.access;
|
||||
# };
|
||||
|
||||
voice = pkgs.testers.runNixOSTest {
|
||||
name = "homeassistant_ldap";
|
||||
|
||||
nodes.server = {
|
||||
imports = [
|
||||
base
|
||||
basic
|
||||
voice
|
||||
];
|
||||
};
|
||||
|
||||
nodes.client = {};
|
||||
|
||||
testScript = commonTestScript.access;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue