refactor(architect/llm.nix): update configuration to use config for host and port

This commit is contained in:
Giulio De Pasquale 2025-03-09 14:31:50 +00:00
parent 4285da55bf
commit d7a3a3bcf3

View File

@ -1,9 +1,8 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
let
backendDomain = "ollama.giugl.io";
ollamaHost = "127.0.0.1";
ollamaPort = 11434;
frontendDomain = "llm.giugl.io";
ollamaPkg = pkgs.unstablePkgs.ollama-cuda;
in
{
@ -15,8 +14,6 @@ in
enable = true;
package = ollamaPkg;
host = ollamaHost;
port = ollamaPort;
acceleration = "cuda";
environmentVariables = {
OLLAMA_FLASH_ATTENTION = "1";
@ -29,15 +26,15 @@ in
dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = {
host = ollamaHost;
port = ollamaPort;
host = config.services.ollama.host;
port = config.services.ollama.port;
allowLan = true;
allowWAN = true;
recommendedProxySettings = false;
extraConfig = ''
proxy_buffering off;
proxy_read_timeout 600s;
proxy_set_header Host localhost:${toString ollamaPort};
proxy_set_header Host localhost:${toString config.services.ollama.host};
'';
};
};