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 let
mkNginxVHosts = inputs.self.lib.mkNginxVHosts; mkNginxVHosts = inputs.self.lib.mkNginxVHosts;
opencodePort = 58801; openWebUiPort = 8080;
opencodePackage = inputs.nix-ai-tools.packages.${pkgs.stdenv.hostPlatform.system}.opencode;
in in
{ {
services.nginx.virtualHosts = mkNginxVHosts { services.nginx.virtualHosts = mkNginxVHosts {
domains = { 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 = { services.open-webui = {
description = "OpenCode Web UI"; enable = true;
wantedBy = [ "multi-user.target" ]; package = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.open-webui;
after = [ "network.target" ]; host = "127.0.0.1";
serviceConfig = { port = openWebUiPort;
Type = "simple"; environment = {
DynamicUser = true; WEBUI_URL = "https://ai.baduhai.dev";
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";
}; };
}; };
} }

View file

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