Compare commits

..

No commits in common. "e98f915103b1f34c867ca9823c85f6423e0467d8" and "4f6d409e8571ad2e2ebbbd235f370a6603e6ff03" have entirely different histories.

4 changed files with 23 additions and 36 deletions

View File

@ -41,7 +41,6 @@ in
./postgres.nix ./postgres.nix
./netdata.nix ./netdata.nix
./homeassistant.nix ./homeassistant.nix
./searx.nix
]; ];
age.identityPaths = [ "/root/.ssh/id_ed25519" ]; age.identityPaths = [ "/root/.ssh/id_ed25519" ];

View File

@ -1,8 +1,9 @@
{ config, pkgs, ... }: { pkgs, ... }:
let let
backendDomain = "ollama.giugl.io"; backendDomain = "ollama.giugl.io";
frontendDomain = "llm.giugl.io"; ollamaHost = "127.0.0.1";
ollamaPort = 11434;
ollamaPkg = pkgs.unstablePkgs.ollama-cuda; ollamaPkg = pkgs.unstablePkgs.ollama-cuda;
in in
{ {
@ -10,47 +11,34 @@ in
systemPackages = [ ollamaPkg ]; systemPackages = [ ollamaPkg ];
}; };
services = { services.ollama = {
ollama = { enable = true;
enable = true;
package = ollamaPkg; package = ollamaPkg;
acceleration = "cuda"; host = ollamaHost;
environmentVariables = { port = ollamaPort;
OLLAMA_FLASH_ATTENTION = "1"; acceleration = "cuda";
OLLAMA_NUM_PARALLEL = "2"; environmentVariables = {
OLLAMA_KV_CACHE_TYPE = "q8_0"; OLLAMA_FLASH_ATTENTION = "1";
}; OLLAMA_NUM_PARALLEL = "2";
OLLAMA_KV_CACHE_TYPE = "q8_0";
}; };
open-webui.enable = true;
}; };
architect.vhost.${backendDomain} = { architect.vhost.${backendDomain} = {
dnsInterfaces = [ "tailscale" "lan" ]; dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = { locations."/" = {
host = config.services.ollama.host; host = ollamaHost;
port = config.services.ollama.port; port = ollamaPort;
allowLan = true; allowLan = true;
allowWAN = true; allowWAN = true;
recommendedProxySettings = false; recommendedProxySettings = false;
extraConfig = '' extraConfig = ''
proxy_buffering off; proxy_buffering off;
proxy_read_timeout 600s; proxy_read_timeout 600s;
proxy_set_header Host localhost:${toString config.services.ollama.host}; proxy_set_header Host localhost:${toString ollamaPort};
''; '';
}; };
}; };
architect.vhost.${frontendDomain} = {
dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = {
host = config.services.open-webui.host;
port = config.services.open-webui.port;
allowLan = true;
allowWAN = true;
};
};
} }

View File

@ -27,7 +27,6 @@ in
safe_search = 0; safe_search = 0;
autocomplete = "google"; autocomplete = "google";
prefer_configured_language = false; prefer_configured_language = false;
formats = [ "html" "json"];
}; };
ui = { ui = {
@ -42,9 +41,10 @@ in
engines = [ engines = [
{ name = "google"; disabled = false; } { name = "google"; disabled = false; }
{ name = "bing"; disabled = false; } { name = "bing"; disabled = false; }
{ name = "qwant"; disabled = true; } { name = "qwant"; disabled = false; }
{ name = "brave"; disabled = true; } { name = "brave"; disabled = false; }
{ name = "duckduckgo"; disabled = false; } # keep getting access denied (!?)
{ name = "duckduckgo"; disabled = true; }
]; ];
}; };
}; };
@ -55,7 +55,7 @@ in
locations."/" = { locations."/" = {
port = config.services.searx.settings.server.port; port = config.services.searx.settings.server.port;
allowLan = true; allowLan = true;
allowWAN = true;
allow = [ allow = [
tailscale.net tailscale.net
]; ];

View File

@ -109,7 +109,7 @@ in
apps = [ apps = [
{ {
name = "Steam w/ Hue Lights"; name = "Steam w/ Hue Lights";
cmd = ''${pkgs.bash}/bin/bash -c "${pkgs.gamescope}/bin/gamescope --adaptive-sync --force-composition --immediate-flips --rt -C 3000 -f -e -W ''${SUNSHINE_CLIENT_WIDTH} -H ''${SUNSHINE_CLIENT_HEIGHT} -r ''${SUNSHINE_CLIENT_FPS} -- ${pkgs.steam}/bin/steam -pipewire"''; cmd = ''${pkgs.bash}/bin/bash -c "${pkgs.gamescope}/bin/gamescope --immediate-flips --rt -C 3000 -f -e -W ''${SUNSHINE_CLIENT_WIDTH} -H ''${SUNSHINE_CLIENT_HEIGHT} -r ''${SUNSHINE_CLIENT_FPS} -- ${pkgs.steam}/bin/steam -pipewire"'';
detached = [ detached = [
"${pkgs.pepePkgs.huenicorn}/bin/huenicorn" "${pkgs.pepePkgs.huenicorn}/bin/huenicorn"
]; ];
@ -122,7 +122,7 @@ in
} }
{ {
name = "Steam"; name = "Steam";
cmd = ''${pkgs.bash}/bin/bash -c "${pkgs.gamescope}/bin/gamescope --adaptive-sync --force-composition --immediate-flips --rt -C 3000 -f -e -W ''${SUNSHINE_CLIENT_WIDTH} -H ''${SUNSHINE_CLIENT_HEIGHT} -r ''${SUNSHINE_CLIENT_FPS} -- ${pkgs.steam}/bin/steam -pipewire"''; cmd = ''${pkgs.bash}/bin/bash -c "${pkgs.gamescope}/bin/gamescope --immediate-flips --rt -C 3000 -f -e -W ''${SUNSHINE_CLIENT_WIDTH} -H ''${SUNSHINE_CLIENT_HEIGHT} -r ''${SUNSHINE_CLIENT_FPS} -- ${pkgs.steam}/bin/steam -pipewire"'';
prep-cmd = [ prep-cmd = [
{ {
do = ''${pkgs.bash}/bin/bash -c "${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT}" ''${SUNSHINE_CLIENT_FPS}"''; do = ''${pkgs.bash}/bin/bash -c "${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT}" ''${SUNSHINE_CLIENT_FPS}"'';