1{ lib, ... }:
2{
3 name = "moodle";
4 meta.maintainers = [ lib.maintainers.aanderse ];
5
6 nodes.machine =
7 { ... }:
8 {
9 services.moodle.enable = true;
10 services.moodle.virtualHost.hostName = "localhost";
11 services.moodle.virtualHost.adminAddr = "root@example.com";
12 services.moodle.initialPassword = "correcthorsebatterystaple";
13
14 # Ensure the virtual machine has enough memory to avoid errors like:
15 # Fatal error: Out of memory (allocated 152047616) (tried to allocate 33554440 bytes)
16 virtualisation.memorySize = 2000;
17 };
18
19 testScript = ''
20 start_all()
21 machine.wait_for_unit("phpfpm-moodle.service", timeout=1800)
22 machine.wait_until_succeeds("curl http://localhost/ | grep 'You are not logged in'")
23 '';
24}