1{ lib, ... }:
2
3{
4 name = "polaris";
5 meta.maintainers = with lib.maintainers; [ pbsds ];
6
7 nodes.machine =
8 { pkgs, ... }:
9 {
10 environment.systemPackages = [ pkgs.jq ];
11 services.polaris = {
12 enable = true;
13 port = 5050;
14 settings.users = [
15 {
16 name = "test_user";
17 password = "very_secret_password";
18 admin = true;
19 }
20 ];
21 };
22 };
23
24 testScript = ''
25 machine.wait_for_unit("polaris.service")
26 machine.wait_for_open_port(5050)
27 machine.succeed("curl http://localhost:5050/api/version")
28 machine.succeed("curl -X GET http://localhost:5050/api/initial_setup -H 'accept: application/json' | jq -e '.has_any_users == true'")
29 '';
30}