mkModule various + fixes

This commit is contained in:
mjallen18
2025-12-18 17:20:21 -06:00
parent e0b1e72431
commit 05486efb75
14 changed files with 200 additions and 398 deletions

View File

@@ -6,29 +6,46 @@
}:
with lib;
let
cfg = config.${namespace}.services.wyoming;
in
{
imports = [ ./options.nix ];
name = "wyoming";
cfg = config.${namespace}.services.${name};
config = mkIf cfg.enable {
services.wyoming = {
faster-whisper.servers.hass-whisper = {
enable = true;
useTransformers = false;
device = lib.mkForce "auto";
language = "en";
model = "distil-large-v3";
uri = "tcp://0.0.0.0:10300";
wyomingConfig = lib.${namespace}.mkModule {
inherit config name;
description = "wyoming protocol";
options = { };
moduleConfig = {
# Open firewall for protonmail bridge if enabled
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [
10200
10300
];
allowedUDPPorts = [
10200
10300
];
};
piper = {
servers.hass-piper = {
services.wyoming = {
faster-whisper.servers.hass-whisper = {
enable = true;
voice = "en-us-ryan-high";
uri = "tcp://0.0.0.0:10200";
useTransformers = false;
device = lib.mkForce "auto";
language = "en";
model = "distil-large-v3";
uri = "tcp://0.0.0.0:10300";
};
piper = {
servers.hass-piper = {
enable = true;
voice = "en-us-ryan-high";
uri = "tcp://0.0.0.0:10200";
};
};
};
};
};
in
{
imports = [ wyomingConfig ];
}

View File

@@ -1,7 +0,0 @@
{ lib, namespace, ... }:
with lib;
{
options.${namespace}.services.wyoming = {
enable = mkEnableOption "enable wyoming";
};
}