docker ollama

This commit is contained in:
2026-01-18 13:34:23 -06:00
parent 69b47de1fc
commit d13b59e7ac
5 changed files with 49 additions and 2 deletions

View File

@@ -61,7 +61,7 @@
pipewire.enable = true;
netbird.enable = true;
ollama.enable = true;
ollama.enable = false;
wyoming = {
enable = true;
piper = false;
@@ -79,8 +79,11 @@
docker = {
enable = true;
nvidia = true;
portainer.enable = true;
pihole.enable = true;
ollama.enable = true;
};
virtualization = {

View File

@@ -21,6 +21,8 @@
config = lib.mkIf config.sysconfig.docker.enable {
networking.nat.internalInterfaces = [ "docker0" ];
virtualisation = {
docker = {
enable = true;

View File

@@ -1 +1,39 @@
{ ... }: {}
{ config, lib, pkgs, ... }: {
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
];
virtualisation.oci-containers.containers.ollama = {
image = "ollama/ollama:latest";
# unstable, waiting for 26.05
#pull = "newer";
hostname = "ollama.local";
ports = [
"127.0.0.1:11434:11434"
];
volumes = [
"vol_ollama:/root/.ollama"
];
cmd = lib.mkIf config.sysconfig.docker.nvidia [
"--device=nvidia.com/gpu=all"
];
environment = {
OLLAMA_CONTEXT_LENGTH = lib.mkDefault "16000";
};
};
};
}

View File

@@ -20,6 +20,8 @@
# unstable, waiting for 26.05
#pull = "newer";
hostname = "pihole.local";
ports = [
"127.0.0.1:9001:80"
"127.0.0.1:53:53/tcp"

View File

@@ -13,6 +13,8 @@
# unstable, waiting for 26.05
#pull = "newer";
hostname = "portainer.local";
ports = [
"127.0.0.1:8000:8000"
"127.0.0.1:9000:9000"