summary refs log tree commit diff stats
path: root/modules/pdf.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pdf.nix')
-rw-r--r--modules/pdf.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/pdf.nix b/modules/pdf.nix
new file mode 100644
index 0000000..06a9539
--- /dev/null
+++ b/modules/pdf.nix
@@ -0,0 +1,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"
+  '';
+}