2025-04-23 00:47:38 +03:00
|
|
|
{ lib, ... }:
|
2021-12-17 15:55:13 -08:00
|
|
|
|
2025-04-01 20:10:43 +02:00
|
|
|
{
|
2025-04-23 00:47:38 +03:00
|
|
|
name = "unifi";
|
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [
|
|
|
|
patryk27
|
|
|
|
zhaofengli
|
|
|
|
];
|
|
|
|
|
|
|
|
node.pkgsReadOnly = false;
|
|
|
|
|
|
|
|
nodes.machine = {
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
services.unifi.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
import json
|
|
|
|
|
|
|
|
start_all()
|
|
|
|
|
|
|
|
machine.wait_for_unit("unifi.service")
|
|
|
|
machine.wait_for_open_port(8880)
|
|
|
|
|
|
|
|
status = json.loads(machine.succeed("curl --silent --show-error --fail-with-body http://localhost:8880/status"))
|
|
|
|
assert status["meta"]["rc"] == "ok"
|
|
|
|
'';
|
2021-12-17 15:55:13 -08:00
|
|
|
}
|