30 lines
660 B
Nix
30 lines
660 B
Nix
|
{ pkgs
|
||
|
, config
|
||
|
, ...
|
||
|
}: {
|
||
|
|
||
|
systemd.services.tts = {
|
||
|
after = [ "network.target" ];
|
||
|
wantedBy = [ "multi-user.target" ];
|
||
|
path = [ pkgs.espeak ];
|
||
|
environment.HOME = "/var/lib/tts";
|
||
|
serviceConfig = {
|
||
|
StateDirectory = "tts";
|
||
|
DynamicUser = true;
|
||
|
User = "tts";
|
||
|
Group = "tts";
|
||
|
ExecStart = ''
|
||
|
${pkgs.tts}/bin/tts-server --model_name tts_models/en/ljspeech/vits --port 5004
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
|
||
|
services.nginx = {
|
||
|
recommendedProxySettings = true;
|
||
|
enable = true;
|
||
|
virtualHosts."tts.${config.networking.hostName}.private" = {
|
||
|
locations."/".proxyPass = "http://localhost:5004";
|
||
|
};
|
||
|
};
|
||
|
}
|