tvl-depot/users/tazjin/nixos/modules/tgsa.nix
Vincent Ambo 507cd85264 feat(tazjin/koptevo): deploy tgsa
The main instance is still running on polyanka, but things are moving
in this direction.

Change-Id: Idfa9e508023c05148003ac4621ae01dceb284c66
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8827
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2023-06-18 12:43:15 +00:00

29 lines
650 B
Nix

{ config, depot, lib, pkgs, ... }:
{
systemd.services.tgsa = {
description = "telegram -> SA bbcode thing";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
Restart = "always";
LoadCredential = "tgsa-yandex.json:/run/agenix/tgsa-yandex";
};
script = ''
export YANDEX_KEY_FILE="''${CREDENTIALS_DIRECTORY}/tgsa-yandex.json"
${depot.users.tazjin.tgsa}/bin/tgsa
'';
};
services.nginx.virtualHosts."tgsa" = {
serverName = "tgsa.tazj.in";
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8472";
};
};
}