From e3229aee417aab918f60ebff38b5580f65265bb0 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 8 Jan 2025 17:46:44 +0100 Subject: [PATCH] fix: ollama models on renaultft feat: homeassistant ollama --- config/services/homeassistant.nix | 4 ++++ config/services/nginx.nix | 2 +- config/services/ollama.nix | 13 ++++++++++--- hosts/elisabeth/guests.nix | 4 +++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/config/services/homeassistant.nix b/config/services/homeassistant.nix index 9eb5cc3..387c36d 100644 --- a/config/services/homeassistant.nix +++ b/config/services/homeassistant.nix @@ -32,6 +32,7 @@ "esphome" #"zha" "mqtt" + "ollama" ]; config = { http = { @@ -86,6 +87,9 @@ "${nodes.${globals.services.adguardhome.host}.config.wireguard.services.ipv4}" = [ "adguardhome.internal" ]; + "${nodes.${globals.services.ollama.host}.config.wireguard.services.ipv4}" = [ + "ollama.internal" + ]; }; age.secrets."home-assistant-secrets.yaml" = { rekeyFile = "${config.node.secretsDir}/secrets.yaml.age"; diff --git a/config/services/nginx.nix b/config/services/nginx.nix index c229409..7a18d43 100644 --- a/config/services/nginx.nix +++ b/config/services/nginx.nix @@ -117,7 +117,7 @@ in recommendedSetup = true; virtualHosts."${globals.services.netbird.domain}".useACMEHost = "web"; upstreams.fritz = { - servers."${lib.net.cidr.host 1 "10.99.2.0/24"}" = { }; + servers."${lib.net.cidr.host 1 "10.99.2.0/24"}:443" = { }; extraConfig = '' zone fritz 64k ; keepalive 5 ; diff --git a/config/services/ollama.nix b/config/services/ollama.nix index 1973408..279a7c1 100644 --- a/config/services/ollama.nix +++ b/config/services/ollama.nix @@ -1,11 +1,16 @@ -{ config, ... }: +{ config, globals, ... }: { wireguard.services = { client.via = "nucnix"; - firewallRuleForNode.nucnix-nginx.allowedTCPPorts = [ config.services.open-webui.port ]; + firewallRuleForNode.${globals.services.nginx.host}.allowedTCPPorts = [ + config.services.open-webui.port + ]; + firewallRuleForNode.${globals.services.homeassistant.host}.allowedTCPPorts = [ + config.services.ollama.port + ]; }; services.ollama = { - host = "localhost"; + host = "0.0.0.0"; port = 3001; enable = true; }; @@ -34,6 +39,8 @@ directory = "/var/lib/private/open-webui"; mode = "0700"; } + ]; + environment.persistence."/renaultft".directories = [ { directory = "/var/lib/private/ollama"; mode = "0700"; diff --git a/hosts/elisabeth/guests.nix b/hosts/elisabeth/guests.nix index 8344388..0836212 100644 --- a/hosts/elisabeth/guests.nix +++ b/hosts/elisabeth/guests.nix @@ -115,7 +115,9 @@ // mkContainer "oauth2-proxy" { } // mkContainer "vaultwarden" { } // mkContainer "ddclient" { } - // mkContainer "ollama" { } + // mkContainer "ollama" { + enableRenaultFT = true; + } // mkContainer "murmur" { } // mkContainer "homebox" { } // mkContainer "invidious" { }