1{ pkgs, ... }:
2{
3 name = "airsonic";
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ sumnerevans ];
6 };
7
8 nodes.machine =
9 { pkgs, ... }:
10 {
11 services.airsonic = {
12 enable = true;
13 maxMemory = 800;
14 };
15 };
16
17 testScript = ''
18 def airsonic_is_up(_) -> bool:
19 status, _ = machine.execute("curl --fail http://localhost:4040/login")
20 return status == 0
21
22
23 machine.start()
24 machine.wait_for_unit("airsonic.service")
25 machine.wait_for_open_port(4040)
26
27 with machine.nested("Waiting for UI to work"):
28 retry(airsonic_is_up)
29 '';
30}