containers: added immich

This commit is contained in:
Victor Ișan 2026-05-10 16:19:36 +02:00
parent 296f55f905
commit 0bde18f234
3 changed files with 84 additions and 1 deletions

View File

@ -20,6 +20,7 @@
../modules/containers/ai.nix
../modules/containers/jitsi.nix
../modules/containers/radarr.nix
../modules/containers/immich.nix
];
# Disks

View File

@ -0,0 +1,82 @@
{ config, ... }:
let
workDir = "/srv/containers/immich";
dataDir = "/srv/data/immich";
nextcloudDir = "/srv/data/nextcloud";
in
{
systemd.tmpfiles.rules = [
"d ${workDir}/cache 2770 root admin"
"d ${workDir}/postgres 0700 999 999"
"d ${dataDir} 2770 root admin"
];
virtualisation.oci-containers.containers = {
immich = {
autoStart = true;
image = "ghcr.io/immich-app/immich-server:v2";
ports = [
"0.0.0.0:10008:2283"
];
volumes = [
"${dataDir}:/usr/src/app/upload"
"${nextcloudDir}:/external/nextcloud:ro"
];
environment = {
TZ = "Europe/Bucharest";
DB_HOSTNAME = "immich-db";
REDIS_HOSTNAME = "immich-redis";
IMMICH_MACHINE_LEARNING_URL = "http://immich-machine-learning:3003";
#DB_STORAGE_TYPE: "HDD";
};
environmentFiles = [
config.age.secrets.immich.path
];
extraOptions = [
"--group-add=10000"
];
dependsOn = [
"immich-db"
"immich-redis"
"immich-machine-learning"
];
};
immich-machine-learning = {
autoStart = true;
image = "ghcr.io/immich-app/immich-machine-learning:v2";
volumes = [
"${workDir}/cache:/cache"
];
};
immich-redis = {
autoStart = true;
image = "redis:8-alpine";
};
immich-db = {
autoStart = true;
image = "ghcr.io/immich-app/postgres:17-vectorchord0.5.3";
environmentFiles = [
config.age.secrets.immich-db.path
];
volumes = [
"${workDir}/postgres:/var/lib/postgresql/data"
];
};
};
}

View File

@ -8,7 +8,7 @@ in
systemd.tmpfiles.rules = [
"d ${workDir}/html 2700 33 33"
"d ${workDir}/db 2700 999 999"
"d ${dataDir} 2700 victor admin"
"d ${dataDir} 2770 33 admin"
];
virtualisation.oci-containers.containers = {