open-webui on alexandria

This commit is contained in:
William 2026-05-03 16:47:41 -03:00
parent 9d0e446731
commit a191be5420
2 changed files with 10 additions and 17 deletions

View file

@ -2,30 +2,23 @@
let
mkNginxVHosts = inputs.self.lib.mkNginxVHosts;
opencodePort = 58801;
opencodePackage = inputs.nix-ai-tools.packages.${pkgs.stdenv.hostPlatform.system}.opencode;
openWebUiPort = 8080;
in
{
services.nginx.virtualHosts = mkNginxVHosts {
domains = {
"ai.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:${toString opencodePort}/";
"ai.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:${toString openWebUiPort}/";
};
};
systemd.services.opencode-web = {
description = "OpenCode Web UI";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "simple";
DynamicUser = true;
StateDirectory = "opencode-web";
WorkingDirectory = "/var/lib/opencode-web";
Environment = "HOME=/var/lib/opencode-web";
ExecStart = "${opencodePackage}/bin/opencode web --hostname 127.0.0.1 --port ${toString opencodePort}";
Restart = "on-failure";
RestartSec = "5s";
services.open-webui = {
enable = true;
package = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.open-webui;
host = "127.0.0.1";
port = openWebUiPort;
environment = {
WEBUI_URL = "https://ai.baduhai.dev";
};
};
}

View file

@ -44,7 +44,7 @@
host = "alexandria";
}
{
name = "opencode-web";
name = "open-webui";
domain = "ai.baduhai.dev";
host = "alexandria";
}