nixos/n8n: improve environment type

This commit is contained in:
Gutyina Gergő
2025-12-25 00:01:12 +01:00
parent 2a45ae2edd
commit 93bb2da08c
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -34,7 +34,13 @@ in
See <https://docs.n8n.io/hosting/configuration/environment-variables/> 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;
+7 -1
View File
@@ -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")
'';
}