58 lines
1.4 KiB
Nix
58 lines
1.4 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.str;
|
|
default = "7706";
|
|
description = "set port for ${service} (default: ${toString cfg.port}";
|
|
};
|
|
piper_port = lib.mkOption {
|
|
type = lib.types.str;
|
|
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:${cfg.faster_whisper_port}";
|
|
model = "medium";
|
|
device = "auto";
|
|
};
|
|
};
|
|
};
|
|
piper = {
|
|
servers = {
|
|
vanessa = {
|
|
enable = true;
|
|
uri = "tcp://0.0.0.0:${cfg.piper_port}";
|
|
voice = "en_US-amy-medium";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# # open firewall
|
|
#networking.firewall.allowedTCPPorts = [ cfg.faster_whisper_port cfg.piper_port ];
|
|
networking.firewall.allowedTCPPorts = [ 7706 7707 ];
|
|
|
|
};
|
|
}
|