containers: added ai
This commit is contained in:
parent
ef91ea4e61
commit
70ee00584d
@ -8,12 +8,16 @@
|
|||||||
# Secrets
|
# Secrets
|
||||||
../modules/agenix.nix
|
../modules/agenix.nix
|
||||||
|
|
||||||
|
# Nvidia
|
||||||
|
../modules/nvidia.nix
|
||||||
|
|
||||||
# Containers
|
# Containers
|
||||||
../modules/containers/ntfy.nix
|
../modules/containers/ntfy.nix
|
||||||
../modules/containers/mindwtr.nix
|
../modules/containers/mindwtr.nix
|
||||||
../modules/containers/vaultwarden.nix
|
../modules/containers/vaultwarden.nix
|
||||||
../modules/containers/nextcloud.nix
|
../modules/containers/nextcloud.nix
|
||||||
../modules/containers/actualbudget.nix
|
../modules/containers/actualbudget.nix
|
||||||
|
../modules/containers/ai.nix
|
||||||
|
|
||||||
];
|
];
|
||||||
# Disks
|
# Disks
|
||||||
|
|||||||
38
modules/containers/ai.nix
Normal file
38
modules/containers/ai.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
workDir = "/srv/containers/ai";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${workDir}/ollama 2700 root admin"
|
||||||
|
"d ${workDir}/open-webui 2700 root admin"
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.nvidia-container-toolkit.enable = true;
|
||||||
|
virtualisation.docker.daemon.settings.features.cdi = true;
|
||||||
|
|
||||||
|
virtualisation.oci-containers.containers = {
|
||||||
|
ollama = {
|
||||||
|
image = "ollama/ollama:latest";
|
||||||
|
volumes = [
|
||||||
|
"${workDir}/ollama:/root/.ollama"
|
||||||
|
];
|
||||||
|
extraOptions = [
|
||||||
|
"--gpus=all"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
open-webui = {
|
||||||
|
image = "ghcr.io/open-webui/open-webui:main";
|
||||||
|
ports = [ "0.0.0.0:10005:8080" ];
|
||||||
|
environment = {
|
||||||
|
OLLAMA_BASE_URL = "http://ollama:11434";
|
||||||
|
};
|
||||||
|
volumes = [
|
||||||
|
"${workDir}/open-webui:/app/backend/data"
|
||||||
|
];
|
||||||
|
dependsOn = [ "ollama" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user