about summary refs log blame commit diff
path: root/users/tazjin/nixos/modules/tgsa.nix
blob: e162e0d8228f730e45249cd2a7c5211a79ef1cee (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                
                                                                  
      




                                                                          







                                        
                                          


      
{ 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";
    };
  };
}