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







                                                
                                                                       











                                                        
                                          


      
{ config, depot, lib, pkgs, ... }:

{
  systemd.services.tgsa = {
    description = "telegram -> SA bbcode thing";
    wantedBy = [ "multi-user.target" ];

    serviceConfig = {
      EnvironmentFile = "/root/tgsa-env"; # TODO(tazjin): automate this
      DynamicUser = true;
      Restart = "always";
      ExecStart = "${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";
    };
  };
}