mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00

- use autoPatchElf - correct supported platforms - use finalAttrs and stdenvNoCC - use runTest - attest the status of the service
30 lines
543 B
Nix
30 lines
543 B
Nix
{ lib, ... }:
|
|
|
|
{
|
|
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"
|
|
'';
|
|
}
|