services-flake/nix/open-webui_test.nix
shivaraj-bh e7eb9dec41 feat(open-webui): init
ported from:
https://github.com/shivaraj-bh/ollama-flake/blob/main/services/open-webui.nix

This was also recently upstreamed to
[nixpkgs](https://github.com/NixOS/nixpkgs/tree/master):
https://github.com/NixOS/nixpkgs/pull/316248

---------

Co-authored-by: Pol Dellaiera <pol.dellaiera@protonmail.com>
Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
2024-06-14 03:11:07 +05:30

22 lines
571 B
Nix

{ pkgs, ... }: {
services.open-webui."open-webui1" = {
enable = true;
environment = {
# Requires network connection
RAG_EMBEDDING_MODEL = "";
};
};
settings.processes.test = {
command = pkgs.writeShellApplication {
runtimeInputs = [ pkgs.curl ];
text = ''
# Avoid printing the entire HTML page on the stdout, we just want to know if the page is active.
curl http://127.0.0.1:1111 > /dev/null
'';
name = "open-webui-test";
};
depends_on."open-webui1".condition = "process_healthy";
};
}