1 import ./make-test-python.nix (
7 meta.maintainers = with lib.maintainers; [ taeer n0emis netali ];
9 nodes.machine = { config, ... }: {
14 services.zammad.enable = true;
15 services.zammad.secretKeyBaseFile = pkgs.writeText "secret" ''
16 52882ef142066e09ab99ce816ba72522e789505caba224a52d750ec7dc872c2c371b2fd19f16b25dfbdd435a4dd46cb3df9f82eb63fafad715056bdfe25740d6
19 systemd.services.zammad-locale-cheat =
20 let cfg = config.services.zammad; in
24 Restart = "on-failure";
29 StateDirectory = "zammad";
30 WorkingDirectory = cfg.dataDir;
32 wantedBy = [ "zammad-web.service" ];
33 description = "Hack in the locale files so zammad doesn't try to access the internet";
35 mkdir -p ./config/translations
36 VERSION=$(cat ${cfg.package}/VERSION)
38 # If these files are not in place, zammad will try to access the internet.
39 # For the test, we only need to supply en-us.
40 echo '[{"locale":"en-us","alias":"en","name":"English (United States)","active":true,"dir":"ltr"}]' \
41 > ./config/locales-$VERSION.yml
42 echo '[{"locale":"en-us","format":"time","source":"date","target":"mm/dd/yyyy","target_initial":"mm/dd/yyyy"},{"locale":"en-us","format":"time","source":"timestamp","target":"mm/dd/yyyy HH:MM","target_initial":"mm/dd/yyyy HH:MM"}]' \
43 > ./config/translations/en-us-$VERSION.yml
50 machine.wait_for_unit("postgresql.service")
51 machine.wait_for_unit("redis-zammad.service")
52 machine.wait_for_unit("zammad-web.service")
53 machine.wait_for_unit("zammad-websocket.service")
54 machine.wait_for_unit("zammad-worker.service")
55 # wait for zammad to fully come up
58 # without the grep the command does not produce valid utf-8 for some reason
59 with subtest("welcome screen loads"):
61 "curl -sSfL http://localhost:3000/ | grep '<title>Zammad Helpdesk</title>'"