From c0b60ac240a036b37db349f7bebe5a1651fb782e Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 5 Feb 2023 06:21:10 +0100 Subject: [PATCH] add tts --- nixos/components/network/tinc/private.nix | 1 + nixos/machines/pepe/configuration.nix | 1 + nixos/machines/pepe/tts.nix | 28 +++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 nixos/machines/pepe/tts.nix diff --git a/nixos/components/network/tinc/private.nix b/nixos/components/network/tinc/private.nix index 2a0ef4a..892a071 100644 --- a/nixos/components/network/tinc/private.nix +++ b/nixos/components/network/tinc/private.nix @@ -19,6 +19,7 @@ let "transmission2.robi" = hosts.robi; "loki.robi" = hosts.robi; "loki.pepe" = hosts.pepe; + "tts.pepe" = hosts.pepe; }; network = "private"; in diff --git a/nixos/machines/pepe/configuration.nix b/nixos/machines/pepe/configuration.nix index 2d3d4b9..d296ba2 100644 --- a/nixos/machines/pepe/configuration.nix +++ b/nixos/machines/pepe/configuration.nix @@ -22,6 +22,7 @@ #./neo4j.nix ./jellyfin.nix ./wireguard.nix + ./tts.nix #./loki.nix diff --git a/nixos/machines/pepe/tts.nix b/nixos/machines/pepe/tts.nix new file mode 100644 index 0000000..b3fe2d2 --- /dev/null +++ b/nixos/machines/pepe/tts.nix @@ -0,0 +1,28 @@ +{ 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"; + }; + }; +}