{ config, lib, ... }: { options.sysconfig.docker.n8n.enable = with lib; mkOption { type = with types; bool; default = false; }; config = lib.mkIf (config.sysconfig.docker.n8n.enable && config.sysconfig.docker.enable) { environment.etc."resolv.conf" = { enable = true; text = '' nameserver 127.0.0.1 nameserver 1.1.1.1 nameserver 1.0.0.1 options edns0 ''; user = "root"; mode = "0664"; }; networking.firewall.interfaces = { "ve-traefik" = { allowedTCPPorts = [ 9001 ]; }; }; virtualisation.oci-containers.containers.n8n = { image = "docker.n8n.io/n8nio/n8n"; # unstable, waiting for 26.05 #pull = "newer"; hostname = "n8n.esotericbytes.com"; networks = [ "docker-main" ]; labels = { "traefik.http.routers.n8n.entrypoints" = "localsecure"; "traefik.http.routers.n8n.rule" = "Host(`n8n.esotericbytes.com`)"; "traefik.http.routers.n8n.service" = "n8n"; "traefik.http.routers.n8n.tls.certResolver" = "cloudflare"; "traefik.http.services.n8n.loadbalancer.server.url" = "http://192.168.100.10:9004"; }; extraOptions = lib.mkIf config.sysconfig.docker.nvidia [ "--ip=192.168.101.7" ]; ports = [ "9004:5678" ]; volumes = [ "vol_n8n:/etc/n8n" ]; environment = { GENERIC_TIMEZONE = "America/Chicago"; TZ = "America/Chicago"; N8N_DIAGNOSTICS_ENABLED = "false"; N8N_VERSION_NOTIFICATIONS_ENABLED = "false"; N8N_TEMPLATES_ENABLED = "false"; EXTERNAL_FRONTEND_HOOKS_URLS = ""; N8N_DIAGNOSTICS_CONFIG_FRONTEND = ""; N8N_DIAGNOSTICS_CONFIG_BACKEND = ""; N8N_SECURE_COOKIE = "false"; }; }; }; }