57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
service = "wyoming";
|
|
cfg = config.homelab.${service};
|
|
sec = config.sops.secrets;
|
|
homelab = config.homelab;
|
|
in {
|
|
options.homelab.${service} = {
|
|
enable = lib.mkEnableOption "enables ${service}";
|
|
|
|
# set port options
|
|
faster_whisper_port = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 7706;
|
|
description = "set port for ${service} (default: ${toString cfg.port}";
|
|
};
|
|
piper_port = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 7707;
|
|
description = "set port for ${service} (default: ${toString cfg.port}";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
# enable the ${service} service
|
|
services.${service} = {
|
|
faster-whisper = {
|
|
servers = {
|
|
vanessa = {
|
|
enable = true;
|
|
language = "en";
|
|
uri = "tcp://0.0.0.0:${toString cfg.faster_whisper_port}";
|
|
model = "medium";
|
|
device = "auto";
|
|
};
|
|
};
|
|
};
|
|
piper = {
|
|
servers = {
|
|
vanessa = {
|
|
enable = true;
|
|
uri = "tcp://0.0.0.0:${toString cfg.piper_port}";
|
|
voice = "en_US-amy-medium";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# open firewall
|
|
networking.firewall.allowedTCPPorts = [cfg.faster_whisper_port cfg.piper_port];
|
|
};
|
|
}
|