nix/home/programs/openwebui.nix
atagen 7485de646a current
linted
2025-02-02 17:07:42 +11:00

48 lines
968 B
Nix

{
lib,
...
}:
let
port = 3021;
in
{
imports = [ ./ollama.nix ];
localWebApps = {
openwebui = {
name = "OpenWebUI";
genericName = "LLM";
icon = ../icons/openwebui.png;
inherit port;
requires.containers = [
"openwebui"
"ollama"
];
};
};
services.podman = {
containers.openwebui =
let
str = builtins.toString;
in
{
# serviceName = "openwebui";
image = "ghcr.io/open-webui/open-webui:main";
ports = [ "${str port}:${str port}" ];
environment = {
WEBUI_AUTH = "False";
PORT = "${str port}";
};
autoStart = false;
networks = [ "ollama" ];
unitConfig = {
Requires = [ "podman-ollama.service" ];
};
extraOptions = [
"--health-cmd"
(lib.escapeShellArg "bash -c 'cat < /dev/null > /dev/tcp/localhost/${str port}'")
];
};
};
}