2024-06-28 00:34:00 +02:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
2019-03-16 13:24:23 +01:00
|
|
|
name = "limesurvey";
|
2024-06-28 00:34:00 +02:00
|
|
|
meta.maintainers = [ lib.maintainers.aanderse ];
|
2019-03-16 13:24:23 +01:00
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine = { ... }: {
|
2020-01-26 12:32:47 +01:00
|
|
|
services.limesurvey = {
|
|
|
|
enable = true;
|
|
|
|
virtualHost = {
|
|
|
|
hostName = "example.local";
|
|
|
|
adminAddr = "root@example.local";
|
|
|
|
};
|
2024-06-28 00:34:00 +02:00
|
|
|
encryptionKeyFile = pkgs.writeText "key" (lib.strings.replicate 32 "0");
|
|
|
|
encryptionNonceFile = pkgs.writeText "nonce" (lib.strings.replicate 24 "0");
|
2019-03-16 13:24:23 +01:00
|
|
|
};
|
|
|
|
|
2020-01-26 12:32:47 +01:00
|
|
|
# limesurvey won't work without a dot in the hostname
|
|
|
|
networking.hosts."127.0.0.1" = [ "example.local" ];
|
|
|
|
};
|
|
|
|
|
2019-03-16 13:24:23 +01:00
|
|
|
testScript = ''
|
2020-01-26 12:32:47 +01:00
|
|
|
start_all()
|
2019-03-16 13:24:23 +01:00
|
|
|
|
2020-01-26 12:32:47 +01:00
|
|
|
machine.wait_for_unit("phpfpm-limesurvey.service")
|
|
|
|
assert "The following surveys are available" in machine.succeed(
|
2020-09-16 17:48:13 +02:00
|
|
|
"curl -f http://example.local/"
|
2020-01-26 12:32:47 +01:00
|
|
|
)
|
2019-03-16 13:24:23 +01:00
|
|
|
'';
|
|
|
|
})
|