about summary refs log tree commit diff
path: root/nixos/tests/open-webui.nix
blob: f10ef1ad98fb08a3721ff987e51897c0f1447989 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, ... }:
let
  mainPort = "8080";
in
{
  name = "open-webui";
  meta = with lib.maintainers; {
    maintainers = [ shivaraj-bh ];
  };

  nodes = {
    machine =
      { ... }:
      {
        services.open-webui = {
          enable = true;
          environment = {
            # Requires network connection
            RAG_EMBEDDING_MODEL = "";
          };
        };
      };
  };

  testScript = ''
    machine.start()

    machine.wait_for_unit("open-webui.service")
    machine.wait_for_open_port(${mainPort})

    machine.succeed("curl http://127.0.0.1:${mainPort}")
  '';
}