Begin Dendritic rewrite
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{ config, lib, pkgs, ... }: let
|
||||
{ ... }: {
|
||||
|
||||
flake.nixosModules.default = { config, lib, pkgs, ... }: let
|
||||
|
||||
hostPort = 11434;
|
||||
|
||||
@@ -6,67 +8,68 @@
|
||||
|
||||
name = "ollama";
|
||||
|
||||
in {
|
||||
in {
|
||||
|
||||
options.sysconfig.docker.ollama.enable = with lib; mkOption {
|
||||
type = with types; bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.sysconfig.docker.ollama.enable && config.sysconfig.docker.enable) {
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
ollama
|
||||
];
|
||||
|
||||
networking.firewall.interfaces = {
|
||||
"ve-traefik" = {
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
|
||||
"ve-openwebui" = {
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
options.sysconfig.docker.ollama.enable = with lib; mkOption {
|
||||
type = with types; bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.ollama = {
|
||||
image = "ollama/ollama:latest";
|
||||
config = lib.mkIf (config.sysconfig.docker.ollama.enable && config.sysconfig.docker.enable) {
|
||||
|
||||
# unstable, waiting for 26.05
|
||||
#pull = "newer";
|
||||
|
||||
hostname = "${subdomain}.esotericbytes.com";
|
||||
|
||||
networks = [
|
||||
"docker-main"
|
||||
environment.systemPackages = with pkgs; [
|
||||
ollama
|
||||
];
|
||||
|
||||
ports = [
|
||||
"${builtins.toString hostPort}:11434"
|
||||
];
|
||||
networking.firewall.interfaces = {
|
||||
"ve-traefik" = {
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
|
||||
volumes = [
|
||||
"vol_ollama:/root/.ollama"
|
||||
];
|
||||
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.http.routers.${name}.entrypoints" = "localsecure";
|
||||
"traefik.http.routers.${name}.rule" = "Host(`${subdomain}.esotericbytes.com`)";
|
||||
"traefik.http.routers.${name}.service" = "${name}";
|
||||
"traefik.http.routers.${name}.tls.certResolver" = "cloudflare";
|
||||
|
||||
#"traefik.http.services.ollama.loadbalancer.server.url" = "http://192.168.100.10:${builtins.toString hostPort}";
|
||||
"traefik.http.services.${name}.loadbalancer.server.port" = "11434";
|
||||
"ve-openwebui" = {
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
};
|
||||
|
||||
extraOptions = lib.mkIf config.sysconfig.docker.nvidia [
|
||||
"--device=nvidia.com/gpu=all"
|
||||
"--ip=192.168.101.22"
|
||||
];
|
||||
virtualisation.oci-containers.containers.ollama = {
|
||||
image = "ollama/ollama:latest";
|
||||
|
||||
environment = {
|
||||
OLLAMA_CONTEXT_LENGTH = lib.mkDefault "32000";
|
||||
# unstable, waiting for 26.05
|
||||
#pull = "newer";
|
||||
|
||||
hostname = "${subdomain}.esotericbytes.com";
|
||||
|
||||
networks = [
|
||||
"docker-main"
|
||||
];
|
||||
|
||||
ports = [
|
||||
"${builtins.toString hostPort}:11434"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"vol_ollama:/root/.ollama"
|
||||
];
|
||||
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.http.routers.${name}.entrypoints" = "localsecure";
|
||||
"traefik.http.routers.${name}.rule" = "Host(`${subdomain}.esotericbytes.com`)";
|
||||
"traefik.http.routers.${name}.service" = "${name}";
|
||||
"traefik.http.routers.${name}.tls.certResolver" = "cloudflare";
|
||||
|
||||
#"traefik.http.services.ollama.loadbalancer.server.url" = "http://192.168.100.10:${builtins.toString hostPort}";
|
||||
"traefik.http.services.${name}.loadbalancer.server.port" = "11434";
|
||||
};
|
||||
|
||||
extraOptions = lib.mkIf config.sysconfig.docker.nvidia [
|
||||
"--device=nvidia.com/gpu=all"
|
||||
"--ip=192.168.101.22"
|
||||
];
|
||||
|
||||
environment = {
|
||||
OLLAMA_CONTEXT_LENGTH = lib.mkDefault "32000";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user