summary refs log tree commit diff stats
path: root/modules/pdf.nix
blob: 06a95390f436637d410c03cc1ae9cc4bddbf2830 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ pkgs, libs, config, ... }:
{

  services.stirling-pdf = {
    enable = true;
    environment = {
      SERVER_PORT = 5031;
    };
  };

  services.nginx.virtualHosts."pdf.krinitsin.com" = {
    forceSSL = true;
    useACMEHost = "krinitsin.com";
    locations."/".proxyPass = "http://localhost:5031";
  };

  security.acme.certs."krinitsin.com".extraDomainNames = [ "pdf.krinitsin.com" ];

  services.monit.config = ''
    check process stirling-pdf with matching "stirling-pdf"
    start program = "${pkgs.systemd}/bin/systemctl start stirling-pdf"
    stop program = "${pkgs.systemd}/bin/systemctl stop stirling-pdf"
  '';
}