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

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

View File

@@ -38,6 +38,7 @@
ENABLE_LOGIN_FORM = "False";
WEBUI_URL = "https://llama.darksailor.dev";
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}";
};

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
./minecraft.nix
./fwupd.nix
./caddy.nix
];
}

View File

@@ -14,6 +14,7 @@
environmentVariables = {
OLLAMA_LLM_LIBRARY = "cuda";
LD_LIBRARY_PATH = "run/opengl-driver/lib";
OLLAMA_ORIGINS = "*";
};
};
open-webui = {
@@ -35,20 +36,7 @@
'';
virtualHosts."ollama.ryu.darksailor.dev".extraConfig = ''
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}
}
respond "Unauthorized" 403
reverse_proxy localhost:${builtins.toString config.services.ollama.port}
'';
};
};