From 734602820bd7e37403271cf9db75dd616975e198 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sun, 31 Aug 2025 16:49:34 +0200 Subject: [PATCH] stirling-pdf: Init module --- hosts/srv-external/default.nix | 9 +++++- modules/system/services/stirling-pdf.nix | 35 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 modules/system/services/stirling-pdf.nix diff --git a/hosts/srv-external/default.nix b/hosts/srv-external/default.nix index 9812722..98f973a 100644 --- a/hosts/srv-external/default.nix +++ b/hosts/srv-external/default.nix @@ -50,6 +50,11 @@ domain = "tools.sprouted.cloud"; }; + stirling-pdf = { + enable = true; + domain = "pdf.sprouted.cloud"; + }; + openspeedtest = { enable = true; domain = "speedtest.sprouted.cloud"; @@ -65,10 +70,12 @@ it-tools = { inherit (config.custom.services.it-tools) domain port; }; + stirling-pdf = { + inherit (config.custom.services.stirling-pdf) domain port; + }; openspeedtest = { inherit (config.custom.services.openspeedtest) domain port; tls = false; - extraReverseProxyConfig = '' request_buffers 35MiB response_buffers 35MiB diff --git a/modules/system/services/stirling-pdf.nix b/modules/system/services/stirling-pdf.nix new file mode 100644 index 0000000..9ec9a0c --- /dev/null +++ b/modules/system/services/stirling-pdf.nix @@ -0,0 +1,35 @@ +{ config, lib, ... }: +let + cfg = config.custom.services.stirling-pdf; +in +{ + options.custom.services.stirling-pdf = { + enable = lib.mkEnableOption ""; + domain = lib.mkOption { + type = lib.types.nonEmptyStr; + default = ""; + }; + port = lib.mkOption { + type = lib.types.port; + default = 56191; + }; + }; + + config = lib.mkIf cfg.enable { + meta = { + domains.list = [ cfg.domain ]; + ports.tcp.list = [ cfg.port ]; + }; + + virtualisation.oci-containers.containers.stirling-pdf = { + image = "stirlingtools/stirling-pdf"; + environment = { + DISABLE_ADDITIONAL_FEATURES = "false"; + SYSTEM_ENABLEANALYTICS = "false"; + LANGS = "de_DE"; + }; + ports = [ "127.0.0.1:${builtins.toString cfg.port}:8080" ]; + pull = "newer"; + }; + }; +}