mkModule various + fixes
This commit is contained in:
@@ -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 ];
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{ lib, namespace, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.services.wyoming = {
|
||||
enable = mkEnableOption "enable wyoming";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user