Files
nix-config/modules/apps/open-webui/default.nix
mjallen18 6d1c6cfc4b updates
2024-05-31 10:55:22 -05:00

34 lines
930 B
Nix

{ lib, pkgs, config, ... }:
with lib;
let cfg = config.nas-apps.open-webui;
in {
imports = [ ./options.nix ];
config = mkIf cfg.enable {
systemd.services.open-webui-docker = {
path = [ pkgs.bash pkgs.docker ];
script = ''
set -e
exec docker run \
--rm \
--gpus all \
--runtime=nvidia \
--name=${cfg.name} \
-e PUID=${cfg.puid} \
-e PGID=${cfg.pgid} \
-e TZ=${cfg.timeZone} \
-e 'NVIDIA_DRIVER_CAPABILITIES'='all' \
-e 'NVIDIA_VISIBLE_DEVICES'='all' \
-p ${cfg.port}:8080 \
-v '${cfg.configPath}:/app/backend/data' \
-v '/mnt/ssd/nix-app-data/ollama:/root/.ollama' \
${cfg.image}
'';
wantedBy = [ "multi-user.target" ];
};
};
}
# --add-host=host.docker.internal:host-gateway \
# -e 'OLLAMA_BASE_URL'='http://10.0.1.18:11434' \