diff --git a/services/cerca.nix b/services/cerca.nix index 30b136d..41bead6 100644 --- a/services/cerca.nix +++ b/services/cerca.nix @@ -1,8 +1,28 @@ +{ pkgs, ... }: { + users.groups.cerca = {}; + users.users.cerca = { + group = "cerca"; + isSystemUser = true; + createHome = false; + home = "/var/www/forum.hermitcollective.net/"; + }; + systemd.services.cerca = { + enable = true; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + description = "The HermitCollective game developer forum"; + serviceConfig = { + Type = "simple"; + User = "cerca"; + WorkingDirectory = "/var/www/forum.hermitcollective.net/"; + ExecStart = "${pkgs.cerca}/bin/cerca --config /var/www/forum.hermitcollective.net/cerca.toml --data /var/www/forum.hermitcollective.net/data --authkey 3330219fde5793b15c57fd58df60a39c3497d64192c68ab9356ddaeb07e5e20e"; + }; + }; # Reqeusts SSL and adds the site to nginx services.nginx.virtualHosts."forum.hermitcollective.net" = { forceSSL = true; enableACME = true; - root = "/var/www/forum.hermitcollective.net"; + locations."/".proxyPass = "http://localhost:8272"; }; }