nix/home/programs/openwebui.nix
2024-11-06 09:53:19 +11:00

40 lines
878 B
Nix

{
lib,
pkgs,
...
}: 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}'")
];
};
};
}