Compare commits
5 Commits
4f6d409e85
...
e98f915103
Author | SHA1 | Date | |
---|---|---|---|
|
e98f915103 | ||
|
068a42db62 | ||
|
1542d67202 | ||
|
d7a3a3bcf3 | ||
|
4285da55bf |
@ -41,6 +41,7 @@ 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" ];
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
backendDomain = "ollama.giugl.io";
|
backendDomain = "ollama.giugl.io";
|
||||||
ollamaHost = "127.0.0.1";
|
frontendDomain = "llm.giugl.io";
|
||||||
ollamaPort = 11434;
|
|
||||||
ollamaPkg = pkgs.unstablePkgs.ollama-cuda;
|
ollamaPkg = pkgs.unstablePkgs.ollama-cuda;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -11,34 +10,47 @@ in
|
|||||||
systemPackages = [ ollamaPkg ];
|
systemPackages = [ ollamaPkg ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.ollama = {
|
services = {
|
||||||
enable = true;
|
ollama = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
package = ollamaPkg;
|
package = ollamaPkg;
|
||||||
host = ollamaHost;
|
acceleration = "cuda";
|
||||||
port = ollamaPort;
|
environmentVariables = {
|
||||||
acceleration = "cuda";
|
OLLAMA_FLASH_ATTENTION = "1";
|
||||||
environmentVariables = {
|
OLLAMA_NUM_PARALLEL = "2";
|
||||||
OLLAMA_FLASH_ATTENTION = "1";
|
OLLAMA_KV_CACHE_TYPE = "q8_0";
|
||||||
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 = ollamaHost;
|
host = config.services.ollama.host;
|
||||||
port = ollamaPort;
|
port = config.services.ollama.port;
|
||||||
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 ollamaPort};
|
proxy_set_header Host localhost:${toString config.services.ollama.host};
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
architect.vhost.${frontendDomain} = {
|
||||||
|
dnsInterfaces = [ "tailscale" "lan" ];
|
||||||
|
|
||||||
|
locations."/" = {
|
||||||
|
host = config.services.open-webui.host;
|
||||||
|
port = config.services.open-webui.port;
|
||||||
|
allowLan = true;
|
||||||
|
allowWAN = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ in
|
|||||||
safe_search = 0;
|
safe_search = 0;
|
||||||
autocomplete = "google";
|
autocomplete = "google";
|
||||||
prefer_configured_language = false;
|
prefer_configured_language = false;
|
||||||
|
formats = [ "html" "json"];
|
||||||
};
|
};
|
||||||
|
|
||||||
ui = {
|
ui = {
|
||||||
@ -41,10 +42,9 @@ in
|
|||||||
engines = [
|
engines = [
|
||||||
{ name = "google"; disabled = false; }
|
{ name = "google"; disabled = false; }
|
||||||
{ name = "bing"; disabled = false; }
|
{ name = "bing"; disabled = false; }
|
||||||
{ name = "qwant"; disabled = false; }
|
{ name = "qwant"; disabled = true; }
|
||||||
{ name = "brave"; disabled = false; }
|
{ name = "brave"; disabled = true; }
|
||||||
# keep getting access denied (!?)
|
{ name = "duckduckgo"; disabled = false; }
|
||||||
{ 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
|
||||||
];
|
];
|
||||||
|
@ -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 --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 --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"'';
|
||||||
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 --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 --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"'';
|
||||||
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}"'';
|
||||||
|
Loading…
Reference in New Issue
Block a user