pwntie: run ollama in a ts reverse proxy

- set OLLAMA_HOST to that by default for gui thing
This commit is contained in:
Aaron Bieber 2024-06-28 08:37:31 -06:00
parent 33747512ae
commit 6505bbb4ae
No known key found for this signature in database
2 changed files with 14 additions and 24 deletions

View File

@ -82,6 +82,7 @@ with lib; {
etc."traygent.json" = { text = traygentCmds; }; etc."traygent.json" = { text = traygentCmds; };
sessionVariables = { sessionVariables = {
SSH_AUTH_SOCK = "$HOME/.traygent"; SSH_AUTH_SOCK = "$HOME/.traygent";
OLLAMA_HOST = "https://ollama.otter-alligator.ts.net";
}; };
systemPackages = with pkgs; (xinlib.filterList [ systemPackages = with pkgs; (xinlib.filterList [
alacritty alacritty

View File

@ -1,10 +1,11 @@
{ pkgs { pkgs
, config , config
, lib
, ... , ...
}: }:
let let
tsAddr = "100.84.170.57"; tsAddr = "100.84.170.57";
#myEmacs = pkgs.callPackage ../../configs/emacs.nix { }; oLlamaPort = 11434;
pubKeys = [ pubKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7v+/xS8832iMqJHCWsxUZ8zYoMWoZhjj++e26g1fLT europa" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7v+/xS8832iMqJHCWsxUZ8zYoMWoZhjj++e26g1fLT europa"
]; ];
@ -39,12 +40,6 @@ in
enable = true; enable = true;
allowedTCPPorts = [ 22 ]; allowedTCPPorts = [ 22 ];
checkReversePath = "loose"; checkReversePath = "loose";
interfaces = {
"tailscale0" =
{
allowedTCPPorts = [ 11434 ];
};
};
}; };
}; };
@ -60,23 +55,12 @@ in
PATH = [ "\${XDG_BIN_HOME}" ]; PATH = [ "\${XDG_BIN_HOME}" ];
}; };
#nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
rtl-sdr rtl-sdr
direwolf direwolf
(callPackage ../../pkgs/rtlamr.nix { }) (callPackage ../../pkgs/rtlamr.nix { })
]; ];
#programs = {
# steam.enable = true;
# _1password.enable = true;
# _1password-gui = {
# enable = true;
# polkitPolicyOwners = [ "qbit" ];
# };
# dconf.enable = true;
#};
xinCI = { xinCI = {
user = "qbit"; user = "qbit";
enable = true; enable = true;
@ -87,16 +71,26 @@ in
ollama = { ollama = {
environment = { environment = {
OLLAMA_ORIGINS = "*"; OLLAMA_ORIGINS = "*";
OLLAMA_HOST = lib.mkForce "0.0.0.0";
}; };
}; };
}; };
}; };
services = { services = {
ts-reverse-proxy = {
servers = {
"ollama-reverse" = {
enable = true;
reverseName = "ollama";
reversePort = oLlamaPort;
};
};
};
ollama = { ollama = {
enable = true; enable = true;
acceleration = "rocm"; acceleration = "rocm";
listenAddress = "${tsAddr}:11434"; listenAddress = "localhost:${toString oLlamaPort}";
}; };
prometheus = { prometheus = {
enable = true; enable = true;
@ -145,11 +139,6 @@ in
]; ];
}; };
}; };
#emacs = {
# enable = true;
# package = myEmacs;
# install = true;
#};
fwupd = { fwupd = {
enable = true; enable = true;
}; };