From a191be5420a91c116b58c11d52c6c8637a7140c9 Mon Sep 17 00:00:00 2001 From: William Date: Sun, 3 May 2026 16:47:41 -0300 Subject: [PATCH] open-webui on alexandria --- aspects/hosts/_alexandria/ai.nix | 25 +++++++++---------------- data/services.nix | 2 +- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/aspects/hosts/_alexandria/ai.nix b/aspects/hosts/_alexandria/ai.nix index 0969177..cb6aedb 100644 --- a/aspects/hosts/_alexandria/ai.nix +++ b/aspects/hosts/_alexandria/ai.nix @@ -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"; }; }; } diff --git a/data/services.nix b/data/services.nix index 4ac2407..de76d5e 100644 --- a/data/services.nix +++ b/data/services.nix @@ -44,7 +44,7 @@ host = "alexandria"; } { - name = "opencode-web"; + name = "open-webui"; domain = "ai.baduhai.dev"; host = "alexandria"; }