nixos-config/nixos/machines/pepe/tts.nix
2023-02-05 06:21:10 +01:00

29 lines
634 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.pepe.private" = {
locations."/".proxyPass = "http://localhost:5004";
};
};
}