at master 741 B view raw
1{ lib, ... }: 2let 3 port = 5678; 4 webhookUrl = "http://example.com"; 5in 6{ 7 name = "n8n"; 8 meta.maintainers = with lib.maintainers; [ 9 freezeboy 10 k900 11 ]; 12 13 node.pkgsReadOnly = false; 14 15 nodes.machine = 16 { ... }: 17 { 18 nixpkgs.config.allowUnfreePredicate = 19 pkg: 20 builtins.elem (lib.getName pkg) [ 21 "n8n" 22 ]; 23 24 services.n8n = { 25 enable = true; 26 webhookUrl = webhookUrl; 27 }; 28 }; 29 30 testScript = '' 31 machine.wait_for_unit("n8n.service") 32 machine.wait_for_console_text("Editor is now accessible via") 33 machine.succeed("curl --fail -vvv http://localhost:${toString port}/") 34 machine.succeed("grep -qF ${webhookUrl} /etc/systemd/system/n8n.service") 35 ''; 36}