about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/web-apps/pretix.nix
blob: 559316f9b85cb629119975814b1b18d2a3cf2b01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  pkgs,
  ...
}:

{
  name = "pretix";
  meta.maintainers = with lib.maintainers; [ hexa ];

  nodes = {
    pretix = {
      networking.extraHosts = ''
        127.0.0.1 tickets.local
      '';

      services.pretix = {
        enable = true;
        nginx.domain = "tickets.local";
        plugins = with pkgs.pretix.plugins; [
          passbook
          pages
        ];
        settings = {
          pretix = {
            instance_name = "NixOS Test";
            url = "http://tickets.local";
          };
          mail.from = "hello@tickets.local";
        };
      };
    };
  };

  testScript = ''
    start_all()

    pretix.wait_for_unit("pretix-web.service")
    pretix.wait_for_unit("pretix-worker.service")

    pretix.wait_until_succeeds("curl -q --fail http://tickets.local")

    pretix.succeed("pretix-manage --help")

    pretix.log(pretix.succeed("systemd-analyze security pretix-web.service"))
  '';
}