From d03b4ba609ba17af4fb4d3be489d92c741c3215b Mon Sep 17 00:00:00 2001 From: Adrian G L Date: Tue, 14 Oct 2025 21:27:46 +0200 Subject: [PATCH] snapshot --- hosts/galadriel/configuration.nix | 10 ++++++ modules/immich.nix | 27 ++++++++++++++++ modules/openwebui.nix | 54 +++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 modules/immich.nix create mode 100644 modules/openwebui.nix diff --git a/hosts/galadriel/configuration.nix b/hosts/galadriel/configuration.nix index ffd9741..c51aa8e 100644 --- a/hosts/galadriel/configuration.nix +++ b/hosts/galadriel/configuration.nix @@ -19,6 +19,16 @@ ../../modules/podman.nix ../../modules/basePackages.nix ../../modules/develPackages.nix + + ../../modules/blog.nix + ../../modules/jupyterhub.nix + ../../modules/jellyfin.nix + ../../modules/qbittorrent.nix + ../../modules/miniflux.rss + ../../modules/mealie.nix + ../../modules/openwebui.nix + ../../modules/ollama.nix + ]; # Bootloader. diff --git a/modules/immich.nix b/modules/immich.nix new file mode 100644 index 0000000..e0d8922 --- /dev/null +++ b/modules/immich.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + ... +}: { + + services.immich = { + enable = true; + #mediaLocation = "/Main/Data/photos"; # Your photo/video directory + + port = 8082; + host = "0.0.0.0"; + openFirewall = true; + + user = "immich"; + group = "immich"; + + machine-learning = { + enable = true; + #environment = { + # CUDA_VISIBLE_DEVICES = "0"; + #}; + }; + + }; +} + diff --git a/modules/openwebui.nix b/modules/openwebui.nix new file mode 100644 index 0000000..c802004 --- /dev/null +++ b/modules/openwebui.nix @@ -0,0 +1,54 @@ +{ config, pkgs, lib, ... }: + +let + stateDir = "/var/lib/open-webui"; + port = 8081; +in +{ + virtualisation = { + podman.enable = true; + podman.dockerCompat = true; + + oci-containers = { + backend = "podman"; + containers = { + openwebui = { + autoStart = true; + image = "ghcr.io/open-webui/open-webui:main"; + ports = [ "0.0.0.0:${lib.mkStr port}:8080" ]; + + environment = { + ANONYMIZED_TELEMETRY = "False"; + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + WEBUI_AUTH = "True"; + #ENABLE_SIGNUP = "True"; + ENABLE_SIGNUP_PASSWORD_CONFIRMATION = "True"; + #DEFAULT_USER_ROLE = "admin"; + ENV = "prod"; + }; + volumes = [ + "${stateDir}:/app/backend/data" + ]; + extraOptions = [ "--pull=always" ]; + }; + }; + }; + }; + + # make sure the directory exists + environment.etc = { + "var/lib/open-webui" = { + source = null; + mode = "0755"; + owner = "root"; + group = "root"; + }; + }; + + # open firewall port 3000 if you run a firewall + networking.firewall = { + allowedTCPPorts = lib.mkList port; + }; +} +