feat: Added resolved to mirai

This commit is contained in:
uttarayan21
2025-07-30 02:20:40 +05:30
parent 3c4626afe7
commit aeb538c308
6 changed files with 14 additions and 15 deletions

View File

@@ -46,7 +46,6 @@
type = "openai-compatible"; type = "openai-compatible";
name = "ryu"; name = "ryu";
api_base = "https://ollama.ryu.darksailor.dev/v1"; api_base = "https://ollama.ryu.darksailor.dev/v1";
api_key_cmd = "cat ${config.sops.secrets."llama/api_key".path}";
models = [ models = [
{ {
name = "RobinBially/nomic-embed-text-8k"; name = "RobinBially/nomic-embed-text-8k";

View File

@@ -15,6 +15,7 @@
./searxng.nix ./searxng.nix
./immich.nix ./immich.nix
./lldap.nix ./lldap.nix
./resolved.nix
# ./home-assistant.nix # ./home-assistant.nix
# ./jellyfin.nix # ./jellyfin.nix

View File

@@ -38,6 +38,7 @@
ENABLE_LOGIN_FORM = "False"; ENABLE_LOGIN_FORM = "False";
WEBUI_URL = "https://llama.darksailor.dev"; WEBUI_URL = "https://llama.darksailor.dev";
OPENAI_BASE_URL = "https://ollama.darksailor.dev/v1"; OPENAI_BASE_URL = "https://ollama.darksailor.dev/v1";
OLLAMA_API_BASE_URL = "https://ollama.ryu.darksailor.dev";
}; };
environmentFile = "${config.sops.templates."LLAMA_API_KEY.env".path}"; environmentFile = "${config.sops.templates."LLAMA_API_KEY.env".path}";
}; };

View File

@@ -0,0 +1,9 @@
{...}: {
services.resolved = {
enable = true;
dnssec = "true";
dnsovertls = "true";
domains = ["lemur-newton.ts.net"];
fallbackDns = ["1.1.1.1"];
};
}

View File

@@ -13,5 +13,6 @@
./resolved.nix ./resolved.nix
./minecraft.nix ./minecraft.nix
./fwupd.nix ./fwupd.nix
./caddy.nix
]; ];
} }

View File

@@ -14,6 +14,7 @@
environmentVariables = { environmentVariables = {
OLLAMA_LLM_LIBRARY = "cuda"; OLLAMA_LLM_LIBRARY = "cuda";
LD_LIBRARY_PATH = "run/opengl-driver/lib"; LD_LIBRARY_PATH = "run/opengl-driver/lib";
OLLAMA_ORIGINS = "*";
}; };
}; };
open-webui = { open-webui = {
@@ -35,20 +36,7 @@
''; '';
virtualHosts."ollama.ryu.darksailor.dev".extraConfig = '' virtualHosts."ollama.ryu.darksailor.dev".extraConfig = ''
import hetzner import hetzner
@apikey {
header Authorization "Bearer {env.LLAMA_API_KEY}"
}
handle @apikey {
header {
# Set response headers or proxy to a different service if API key is valid
Access-Control-Allow-Origin *
-Authorization "Bearer {env.LLAMA_API_KEY}" # Remove the header after validation
}
reverse_proxy localhost:${builtins.toString config.services.ollama.port} reverse_proxy localhost:${builtins.toString config.services.ollama.port}
}
respond "Unauthorized" 403
''; '';
}; };
}; };