1{ pkgs, ... }:
2let
3 extraHosts = ''
4 192.168.13.12 agenda.example.com
5 '';
6in
7{
8 name = "gancio";
9 meta.maintainers = with pkgs.lib.maintainers; [ jbgi ];
10
11 nodes = {
12 server =
13 { pkgs, ... }:
14 {
15 networking = {
16 interfaces.eth1 = {
17 ipv4.addresses = [
18 {
19 address = "192.168.13.12";
20 prefixLength = 24;
21 }
22 ];
23 };
24 inherit extraHosts;
25 firewall.allowedTCPPorts = [ 80 ];
26 };
27 environment.systemPackages = [ pkgs.gancio ];
28 services.gancio = {
29 enable = true;
30 settings = {
31 hostname = "agenda.example.com";
32 db.dialect = "postgres";
33 };
34 plugins = [ pkgs.gancioPlugins.telegram-bridge ];
35 userLocale = {
36 en = {
37 register = {
38 description = "My new registration page description";
39 };
40 };
41 };
42 nginx = {
43 enableACME = false;
44 forceSSL = false;
45 };
46 };
47 };
48
49 client =
50 { pkgs, ... }:
51 {
52 environment.systemPackages = [ pkgs.jq ];
53 networking = {
54 interfaces.eth1 = {
55 ipv4.addresses = [
56 {
57 address = "192.168.13.1";
58 prefixLength = 24;
59 }
60 ];
61 };
62 inherit extraHosts;
63 };
64 };
65 };
66
67 testScript = ''
68 start_all()
69
70 server.wait_for_unit("postgresql.target")
71 server.wait_for_unit("gancio")
72 server.wait_for_unit("nginx")
73 server.wait_for_file("/run/gancio/socket")
74 server.wait_for_open_port(80)
75
76 # Check can create user via cli
77 server.succeed("cd /var/lib/gancio && sudo -u gancio gancio users create admin dummy admin")
78
79 # Check event list is returned
80 client.wait_until_succeeds("curl --verbose --fail-with-body http://agenda.example.com/api/events", timeout=30)
81
82 server.shutdown()
83 client.shutdown()
84 '';
85}