tfc-nixos/modules/ollama.nix

41 lines
893 B
Nix

{ config, lib, pkgs, unstable, ... }:
let
dn = "chatai.tfcconnection.org";
in with lib;
{
services = {
ollama = {
enable = true;
host = "0.0.0.0";
package = unstable.ollama;
# port = 11434;
acceleration = "cuda";
};
open-webui = {
enable = true;
port = 3082;
host = "0.0.0.0";
package = unstable.open-webui;
# pytestCheckPhase = false;
# doCheck = false;
# doInstallCheck = false;
# nativeCheckInputs = [];
# pythonImportsCheck = [];
# passthru = {};
# disabledTests = [
# "async"
# ];
# };
};
nginx.virtualHosts.${dn} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.open-webui.port}";
proxyWebsockets = true;
};
};
};
}