alexandria: serve opencode web at ai.baduhai.dev
This commit is contained in:
parent
6105247c72
commit
d1df81bf71
2 changed files with 36 additions and 0 deletions
31
aspects/hosts/_alexandria/ai.nix
Normal file
31
aspects/hosts/_alexandria/ai.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{ inputs, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
mkNginxVHosts = inputs.self.lib.mkNginxVHosts;
|
||||||
|
opencodePort = 58801;
|
||||||
|
opencodePackage = inputs.nix-ai-tools.packages.${pkgs.stdenv.hostPlatform.system}.opencode;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts = mkNginxVHosts {
|
||||||
|
domains = {
|
||||||
|
"ai.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:${toString opencodePort}/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -43,5 +43,10 @@
|
||||||
domain = "read.baduhai.dev";
|
domain = "read.baduhai.dev";
|
||||||
host = "alexandria";
|
host = "alexandria";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "opencode-web";
|
||||||
|
domain = "ai.baduhai.dev";
|
||||||
|
host = "alexandria";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue