nixos-config/nixos/machines/chungus/tts.nix

30 lines
660 B
Nix
Raw Normal View History

2023-06-21 08:34:43 +02:00
{ 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";
};
};
}