This commit is contained in:
Yan Lin 2025-12-03 00:50:16 +01:00
parent a003d3ca2d
commit 839a337003

View file

@ -1,77 +1,61 @@
# Immich photo and video backup system configuration
# This configuration is used by the Immich container in modules/podman.nix
# Documentation: https://immich.app/docs/install/config-file/
{ {
# Database backup configuration
backup.database = { backup.database = {
cronExpression = "0 02 * * *"; # Daily at 2 AM cronExpression = "0 02 * * *";
enabled = false; # Using Borg backup instead enabled = false; # Using Borg backup instead
keepLastAmount = 14; # Keep 14 days of backups when enabled keepLastAmount = 14;
}; };
# Video transcoding configuration
ffmpeg = { ffmpeg = {
# Hardware acceleration using Intel QuickSync Video accel = "qsv"; # Intel QuickSync Video
accel = "qsv";
accelDecode = true; accelDecode = true;
# Accepted codecs for direct playback (no transcoding needed)
acceptedAudioCodecs = [ "aac" "mp3" "libopus" "pcm_s16le" ]; acceptedAudioCodecs = [ "aac" "mp3" "libopus" "pcm_s16le" ];
acceptedContainers = [ "mov" "ogg" "webm" ]; acceptedContainers = [ "mov" "ogg" "webm" ];
acceptedVideoCodecs = [ "h264" ]; acceptedVideoCodecs = [ "h264" ];
# Encoding settings bframes = -1; # auto
bframes = -1; # Auto-detect optimal B-frames
cqMode = "auto"; cqMode = "auto";
crf = 23; # Constant Rate Factor (lower = better quality, larger files) crf = 23; # lower = better quality, larger files
gopSize = 0; # Auto-detect GOP size gopSize = 0; # auto
maxBitrate = "0"; # No bitrate limit maxBitrate = "0"; # unlimited
preferredHwDevice = "auto"; preferredHwDevice = "auto";
preset = "ultrafast"; # Fastest encoding preset preset = "ultrafast";
refs = 0; # Auto-detect reference frames refs = 0; # auto
# Target formats for transcoding
targetAudioCodec = "aac"; targetAudioCodec = "aac";
targetResolution = "720"; # Transcode to 720p max targetResolution = "720";
targetVideoCodec = "h264"; targetVideoCodec = "h264";
# Advanced settings
temporalAQ = false; temporalAQ = false;
threads = 0; # Use all available CPU threads threads = 0; # all available
tonemap = "hable"; # HDR to SDR tone mapping algorithm tonemap = "hable"; # HDR to SDR tone mapping
transcode = "bitrate"; # Transcoding strategy transcode = "bitrate";
twoPass = false; # Single-pass encoding for speed twoPass = false;
}; };
# Image processing configuration
image = { image = {
colorspace = "p3"; # Display P3 color space colorspace = "p3";
extractEmbedded = true; # Extract embedded preview images from RAW files extractEmbedded = true; # from RAW files
# Full-size image settings
fullsize = { fullsize = {
enabled = true; enabled = true;
format = "jpeg"; format = "jpeg";
quality = 80; quality = 80;
}; };
# Preview image settings (for web UI)
preview = { preview = {
format = "jpeg"; format = "jpeg";
quality = 80; quality = 80;
size = 1440; # Max dimension in pixels size = 1440;
}; };
# Thumbnail settings
thumbnail = { thumbnail = {
format = "webp"; # Modern format for smaller files format = "webp"; # smaller files
quality = 80; quality = 80;
size = 250; # Max dimension in pixels size = 250;
}; };
}; };
# Background job concurrency settings
job = { job = {
backgroundTask.concurrency = 5; backgroundTask.concurrency = 5;
faceDetection.concurrency = 2; # CPU-intensive faceDetection.concurrency = 2; # CPU-intensive
@ -84,50 +68,43 @@
ocr.concurrency = 1; # ML-intensive ocr.concurrency = 1; # ML-intensive
smartSearch.concurrency = 2; # ML-intensive smartSearch.concurrency = 2; # ML-intensive
thumbnailGeneration.concurrency = 7; thumbnailGeneration.concurrency = 7;
videoConversion.concurrency = 1; # Hardware-accelerated, serialize for stability videoConversion.concurrency = 1; # serialize for stability
}; };
# External library management
library = { library = {
scan = { scan = {
cronExpression = "0 19 * * *"; cronExpression = "0 19 * * *";
enabled = false; # Scan external libraries for changes enabled = true;
}; };
watch.enabled = true; # Don't watch for real-time changes (saves resources) watch.enabled = false;
}; };
# Logging configuration
logging = { logging = {
enabled = true; enabled = true;
level = "log"; # Options: verbose, debug, log, warn, error level = "log"; # verbose, debug, log, warn, error
}; };
# Machine learning configuration
machineLearning = { machineLearning = {
enabled = true; enabled = true;
# CLIP model for smart search
clip = { clip = {
enabled = true; enabled = true;
modelName = "immich-app/ViT-SO400M-16-SigLIP2-384__webli"; # Large model for better accuracy modelName = "immich-app/ViT-SO400M-16-SigLIP2-384__webli"; # smart search
}; };
# Duplicate photo detection
duplicateDetection = { duplicateDetection = {
enabled = false; enabled = false;
maxDistance = 0.01; # Similarity threshold (lower = more similar) maxDistance = 0.01; # lower = more similar
}; };
# Facial recognition
facialRecognition = { facialRecognition = {
enabled = true; enabled = true;
maxDistance = 0.5; # Face similarity threshold maxDistance = 0.5;
minFaces = 3; # Minimum faces to create a person minFaces = 3;
minScore = 0.7; # Face detection confidence threshold minScore = 0.7;
modelName = "buffalo_l"; # Large model for better accuracy modelName = "buffalo_l";
}; };
# Optical Character Recognition
ocr = { ocr = {
enabled = true; enabled = true;
maxResolution = 736; maxResolution = 736;
@ -136,38 +113,32 @@
modelName = "PP-OCRv5_server"; modelName = "PP-OCRv5_server";
}; };
# ML processing URLs (internal container network) urls = [ "http://127.0.0.1:3003" ]; # internal container network
urls = [ "http://127.0.0.1:3003" ];
}; };
# Map configuration for geo-location features
map = { map = {
enabled = true; enabled = true;
darkStyle = "https://tiles.immich.cloud/v1/style/dark.json"; darkStyle = "https://tiles.immich.cloud/v1/style/dark.json";
lightStyle = "https://tiles.immich.cloud/v1/style/light.json"; lightStyle = "https://tiles.immich.cloud/v1/style/light.json";
}; };
# Metadata handling
metadata = { metadata = {
faces.import = false; # Don't import face tags from image metadata faces.import = false;
}; };
# Version checking
newVersionCheck.enabled = false; newVersionCheck.enabled = false;
# Nightly maintenance tasks
nightlyTasks = { nightlyTasks = {
clusterNewFaces = true; # Group new faces with existing people clusterNewFaces = true;
databaseCleanup = true; # Clean up orphaned database entries databaseCleanup = true;
generateMemories = true; # Create "On This Day" memories generateMemories = true;
missingThumbnails = true; # Generate missing thumbnails missingThumbnails = true;
startTime = "00:00"; # Midnight startTime = "00:00";
syncQuotaUsage = true; # Update storage quota calculations syncQuotaUsage = true;
}; };
# Email notifications (disabled - using Gotify instead)
notifications.smtp = { notifications.smtp = {
enabled = false; enabled = false; # using Gotify instead
from = ""; from = "";
replyTo = ""; replyTo = "";
transport = { transport = {
@ -179,9 +150,8 @@
}; };
}; };
# OAuth configuration (disabled - using local accounts)
oauth = { oauth = {
enabled = false; enabled = false; # using local accounts
autoLaunch = false; autoLaunch = false;
autoRegister = true; autoRegister = true;
buttonText = "Login with OAuth"; buttonText = "Login with OAuth";
@ -201,45 +171,36 @@
tokenEndpointAuthMethod = "client_secret_post"; tokenEndpointAuthMethod = "client_secret_post";
}; };
# Password login configuration
passwordLogin.enabled = true; passwordLogin.enabled = true;
# Reverse geocoding for location names
reverseGeocoding.enabled = true; reverseGeocoding.enabled = true;
# Server configuration
server = { server = {
externalDomain = "https://photo.yanlincs.com"; # Public URL externalDomain = "https://photo.yanlincs.com";
loginPageMessage = ""; loginPageMessage = "";
publicUsers = true; # Allow public user profiles publicUsers = true;
}; };
# File organization template
storageTemplate = { storageTemplate = {
enabled = true; enabled = true;
hashVerificationEnabled = true; # Verify file integrity hashVerificationEnabled = true;
# Organize files by year/month-day/original-filename template = "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}"; # year/year-month-day/filename
template = "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}";
}; };
# Email templates (empty - using defaults)
templates.email = { templates.email = {
albumInviteTemplate = ""; albumInviteTemplate = "";
albumUpdateTemplate = ""; albumUpdateTemplate = "";
welcomeTemplate = ""; welcomeTemplate = "";
}; };
# Theme customization
theme.customCss = ""; theme.customCss = "";
# Trash/recycle bin configuration
trash = { trash = {
enabled = true; enabled = true;
days = 30; # Keep deleted items for 30 days days = 30;
}; };
# User management
user = { user = {
deleteDelay = 7; # Days before permanently deleting user data deleteDelay = 7;
}; };
} }