50 lines
1.4 KiB
Nix
50 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: {
|
|
options.services.wyoming.enable = lib.mkEnableOption "should wyoming be enabled on this device";
|
|
config = lib.mkIf config.services.wyoming.enable (lib.mkMerge [
|
|
{
|
|
services.wyoming.piper = {
|
|
servers = {
|
|
"en" = {
|
|
enable = true;
|
|
# see https://github.com/rhasspy/rhasspy3/blob/master/programs/tts/piper/script/download.py
|
|
voice = "en-us-amy-low";
|
|
uri = "tcp://0.0.0.0:10200";
|
|
speaker = 0;
|
|
};
|
|
};
|
|
};
|
|
|
|
services.wyoming.faster-whisper = {
|
|
servers = {
|
|
"en" = {
|
|
enable = true;
|
|
# see https://github.com/rhasspy/rhasspy3/blob/master/programs/asr/faster-whisper/script/download.py
|
|
model = "tiny-int8";
|
|
language = "en";
|
|
uri = "tcp://0.0.0.0:10300";
|
|
device = "cpu";
|
|
};
|
|
};
|
|
};
|
|
|
|
# needs access to /proc/cpuinfo
|
|
systemd.services."wyoming-faster-whisper-en".serviceConfig.ProcSubset = lib.mkForce "all";
|
|
}
|
|
(lib.mkIf config.host.impermanence.enable {
|
|
environment.persistence."/persist/system/root" = {
|
|
enable = true;
|
|
hideMounts = true;
|
|
directories = [
|
|
{
|
|
directory = "/var/lib/private/wyoming";
|
|
mode = "0700";
|
|
}
|
|
];
|
|
};
|
|
})
|
|
]);
|
|
}
|