From 93bb2da08c1466e2f33b0f7d35846e14404d41cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Thu, 25 Dec 2025 00:01:12 +0100 Subject: [PATCH] nixos/n8n: improve environment type --- nixos/modules/services/misc/n8n.nix | 8 +++++++- nixos/tests/n8n.nix | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/misc/n8n.nix b/nixos/modules/services/misc/n8n.nix index a112786cc2d9..1b66a4c7705b 100644 --- a/nixos/modules/services/misc/n8n.nix +++ b/nixos/modules/services/misc/n8n.nix @@ -34,7 +34,13 @@ in See for available options. ''; type = lib.types.submodule { - freeformType = with lib.types; attrsOf str; + freeformType = + with lib.types; + attrsOf (oneOf [ + str + (coercedTo int toString str) + (coercedTo bool builtins.toJSON str) + ]); options = { GENERIC_TIMEZONE = lib.mkOption { type = with lib.types; nullOr str; diff --git a/nixos/tests/n8n.nix b/nixos/tests/n8n.nix index 61216b7b0ac4..7936500a4d53 100644 --- a/nixos/tests/n8n.nix +++ b/nixos/tests/n8n.nix @@ -14,7 +14,11 @@ in { services.n8n = { enable = true; - environment.WEBHOOK_URL = webhookUrl; + environment = { + WEBHOOK_URL = webhookUrl; + N8N_TEMPLATES_ENABLED = false; + DB_PING_INTERVAL_SECONDS = 2; + }; }; }; @@ -26,5 +30,7 @@ in machine.succeed("grep -qF 'HOME=/var/lib/n8n' /etc/systemd/system/n8n.service") machine.fail("grep -qF 'GENERIC_TIMEZONE=' /etc/systemd/system/n8n.service") machine.succeed("grep -qF 'N8N_DIAGNOSTICS_ENABLED=false' /etc/systemd/system/n8n.service") + machine.succeed("grep -qF 'N8N_TEMPLATES_ENABLED=false' /etc/systemd/system/n8n.service") + machine.succeed("grep -qF 'DB_PING_INTERVAL_SECONDS=2' /etc/systemd/system/n8n.service") ''; }