136 lines
4.3 KiB
Nix
136 lines
4.3 KiB
Nix
{ config, lib, ... }: {
|
|
|
|
options.sysconfig.virtualization.wyoming = {
|
|
enable = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
piper = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
openwakeword = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
faster-whisper = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
satellite = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.sysconfig.virtualization.wyoming.enable {
|
|
|
|
containers.wyoming = {
|
|
|
|
autoStart = true;
|
|
privateNetwork = true;
|
|
hostAddress = "192.168.100.10";
|
|
localAddress = "192.168.100.26";
|
|
|
|
bindMounts = lib.mkIf config.sysconfig.virtualization.wyoming.faster-whisper {
|
|
"/dev/nvidia0" = {
|
|
hostPath = "/dev/nvidia0";
|
|
isReadOnly = false;
|
|
};
|
|
"/dev/nvidiactl" = {
|
|
hostPath = "/dev/nvidiactl";
|
|
isReadOnly = false;
|
|
};
|
|
"/dev/nvidia-uvm" = {
|
|
hostPath = "/dev/nvidia-uvm";
|
|
isReadOnly = false;
|
|
};
|
|
"/dev/nvidia-modeset" = {
|
|
hostPath = "/dev/nvidia-modeset";
|
|
isReadOnly = false;
|
|
};
|
|
"/dev/nvidia-uvm-tools" = {
|
|
hostPath = "/dev/nvidia-uvm-tools";
|
|
isReadOnly = false;
|
|
};
|
|
};
|
|
|
|
allowedDevices = lib.mkIf config.sysconfig.virtualization.wyoming.faster-whisper [
|
|
{
|
|
node = "/dev/nvidia0";
|
|
modifier = "rw";
|
|
}
|
|
{
|
|
node = "/dev/nvidiactl";
|
|
modifier = "rw";
|
|
}
|
|
{
|
|
node = "/dev/nvidia-uvm";
|
|
modifier = "rw";
|
|
}
|
|
{
|
|
node = "/dev/nvidia-modeset";
|
|
modifier = "rw";
|
|
}
|
|
{
|
|
node = "/dev/nvidia-uvm-tools";
|
|
modifier = "rw";
|
|
}
|
|
];
|
|
|
|
config = {
|
|
|
|
networking.firewall = {
|
|
allowedTCPPorts = [ 11431 11432 11433 11435 ];
|
|
};
|
|
|
|
services.wyoming = {
|
|
|
|
piper = lib.mkIf config.sysconfig.virtualization.wyoming.piper {
|
|
|
|
servers.piper = {
|
|
enable = true;
|
|
voice = "en-us-ryan-medium";
|
|
uri = "tcp://0.0.0.0:11435";
|
|
};
|
|
};
|
|
|
|
openwakeword = lib.mkIf config.sysconfig.virtualization.wyoming.openwakeword {
|
|
enable = true;
|
|
uri = "tcp://0.0.0.0:11432";
|
|
preloadModels = [
|
|
"alexa"
|
|
"hey_jarvis"
|
|
"ok_nabu"
|
|
];
|
|
threshold = 0.5;
|
|
customModelsDirectories = [
|
|
#./wake_words
|
|
];
|
|
};
|
|
|
|
faster-whisper = lib.mkIf config.sysconfig.virtualization.wyoming.faster-whisper {
|
|
servers.whisper = {
|
|
enable = true;
|
|
device = "auto";
|
|
language = "en";
|
|
model = "medium.en";
|
|
uri = "tcp://0.0.0.0:11433";
|
|
};
|
|
};
|
|
|
|
satellite = lib.mkIf config.sysconfig.virtualization.wyoming.satellite {
|
|
enable = true;
|
|
uri = "tcp://0.0.0.0:11431";
|
|
#user = "nathan";
|
|
vad.enable = false;
|
|
};
|
|
};
|
|
|
|
system.stateVersion = "25.05";
|
|
};
|
|
};
|
|
|
|
};
|
|
}
|