From d7a3a3bcf3c2cab52cdae0e013aea6a2c745fbb5 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sun, 9 Mar 2025 14:31:50 +0000 Subject: [PATCH] refactor(architect/llm.nix): update configuration to use `config` for host and port --- hosts/architect/llm.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hosts/architect/llm.nix b/hosts/architect/llm.nix index 56bc58b..ce62c55 100644 --- a/hosts/architect/llm.nix +++ b/hosts/architect/llm.nix @@ -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}; ''; }; };