From 3d33c5c7dfb31c31d7383afbc91873dbdf18f582 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Tue, 27 Jun 2023 21:16:33 +0100 Subject: [PATCH] n8n: add WEBHOOK_URL environment variable The WEBHOOK_URL options is only able to be set through environment variables. Was considering adding a more generic "environment" parameter but wasn't sure the best way to approach this. --- nixos/modules/services/misc/n8n.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/services/misc/n8n.nix b/nixos/modules/services/misc/n8n.nix index cdfe9dc8482c..c72ed106f2d9 100644 --- a/nixos/modules/services/misc/n8n.nix +++ b/nixos/modules/services/misc/n8n.nix @@ -26,6 +26,15 @@ in ''; }; + webhookUrl = mkOption { + type = types.string; + default = ""; + description = lib.mdDoc '' + WEBHOOK_URL for n8n, in case we're running behind a reverse proxy. + This cannot be set through configuration and must reside in an environment variable. + ''; + }; + }; config = mkIf cfg.enable { @@ -44,6 +53,7 @@ in N8N_USER_FOLDER = "/var/lib/n8n"; HOME = "/var/lib/n8n"; N8N_CONFIG_FILES = "${configFile}"; + WEBHOOK_URL = "${webhookUrl}"; # Don't phone home N8N_DIAGNOSTICS_ENABLED = "false";