1{ lib, pkgs, ... }:
2{
3 name = "limesurvey";
4 meta.maintainers = [ lib.maintainers.aanderse ];
5
6 nodes.machine =
7 { ... }:
8 {
9 services.limesurvey = {
10 enable = true;
11 virtualHost = {
12 hostName = "example.local";
13 adminAddr = "root@example.local";
14 };
15 encryptionKeyFile = pkgs.writeText "key" (lib.strings.replicate 32 "0");
16 encryptionNonceFile = pkgs.writeText "nonce" (lib.strings.replicate 24 "0");
17 };
18
19 # limesurvey won't work without a dot in the hostname
20 networking.hosts."127.0.0.1" = [ "example.local" ];
21 };
22
23 testScript = ''
24 start_all()
25
26 machine.wait_for_unit("phpfpm-limesurvey.service")
27 assert "The following surveys are available" in machine.succeed(
28 "curl -f http://example.local/"
29 )
30 '';
31}