2025-05-24 23:40:23 +08:00
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
|
|
port = "7745";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
name = "homebox";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ patrickdag ];
|
|
|
|
};
|
|
|
|
nodes =
|
|
|
|
let
|
|
|
|
self = {
|
|
|
|
simple = {
|
|
|
|
services.homebox = {
|
|
|
|
enable = true;
|
|
|
|
settings.HBOX_WEB_PORT = port;
|
2025-04-07 21:43:39 +01:00
|
|
|
};
|
2025-05-24 23:40:23 +08:00
|
|
|
};
|
2025-04-07 21:43:39 +01:00
|
|
|
|
2025-05-24 23:40:23 +08:00
|
|
|
postgres = {
|
|
|
|
imports = [ self.simple ];
|
|
|
|
services.homebox.database.createLocally = true;
|
2025-04-07 21:43:39 +01:00
|
|
|
};
|
2025-05-24 23:40:23 +08:00
|
|
|
};
|
|
|
|
in
|
|
|
|
self;
|
|
|
|
testScript = ''
|
|
|
|
def test_homebox(node):
|
|
|
|
node.wait_for_unit("homebox.service")
|
|
|
|
node.wait_for_open_port(${port})
|
2025-04-07 21:43:39 +01:00
|
|
|
|
2025-05-24 23:40:23 +08:00
|
|
|
node.succeed("curl --fail -X GET 'http://localhost:${port}/'")
|
|
|
|
out = node.succeed("curl --fail 'http://localhost:${port}/api/v1/status'")
|
|
|
|
assert '"health":true' in out
|
2024-06-15 15:25:40 +02:00
|
|
|
|
2025-05-24 23:40:23 +08:00
|
|
|
test_homebox(simple)
|
|
|
|
simple.send_monitor_command("quit")
|
|
|
|
simple.wait_for_shutdown()
|
|
|
|
test_homebox(postgres)
|
|
|
|
'';
|
|
|
|
}
|