hosts/library: add open-webui
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m17s

This commit is contained in:
2025-06-02 23:21:29 +01:00
parent 471c46d4cb
commit 13163dc1fb
6 changed files with 60 additions and 4 deletions

34
hosts/library/ai.nix Normal file
View File

@ -0,0 +1,34 @@
{
inputs,
config,
pkgs,
...
}:
{
age.secrets."files/services/open-webui/envfile" = {
file = "${inputs.secrets}/files/services/open-webui/envfile.age";
};
services.open-webui = {
enable = true;
package = pkgs.unstable.open-webui;
port = 8081;
environment =
let
clientId = "open-webui";
publicUrl = "https://chat.ai.vimium.com";
in
{
WEBUI_URL = publicUrl;
ENABLE_LOGIN_FORM = "False";
ENABLE_OAUTH_SIGNUP = "True";
ENABLE_OAUTH_ROLE_MANAGEMENT = "True";
OAUTH_CLIENT_ID = clientId;
OAUTH_PROVIDER_NAME = "Vimium";
OPENID_PROVIDER_URL = "https://auth.vimium.com/oauth2/openid/${clientId}/.well-known/openid-configuration";
OPENID_REDIRECT_URI = "${publicUrl}/oauth/oidc/callback";
};
environmentFile = config.age.secrets."files/services/open-webui/envfile".path;
};
}

View File

@ -5,6 +5,7 @@
{
imports = [
./hardware-configuration.nix
./ai.nix
./grafana.nix
./jellyfin.nix
./nginx.nix

View File

@ -36,6 +36,18 @@
'';
};
};
"chat.ai.vimium.com" = {
listen = [
{
addr = "127.0.0.1";
port = 8001;
}
];
locations."/" = {
proxyPass = "http://localhost:8081";
extraConfig = proxyConfig;
};
};
"jellyfin.vimium.com" = {
default = true;
listen = [

View File

@ -22,6 +22,7 @@
-o TCPKeepAlive=no \
-i %h/.ssh/id_jellyfin \
-R localhost:8000:localhost:8000 \
-R localhost:8001:localhost:8001 \
jellyfin@vps1.mesh.vimium.net
'';
Restart = "always";

View File

@ -85,6 +85,14 @@ in
virtualHosts =
{
## Static sites
"chat.ai.vimium.com" = {
forceSSL = true;
enableACME = true;
extraConfig = nginxErrorPages + nginxEdgeHeaders;
locations."/" = {
proxyPass = "http://localhost:8001";
};
};
"jellyfin.vimium.com" = {
forceSSL = true;
enableACME = true;