nixfleet/modules/immich/default.nix
Andrea Ciceri 908508743b
Some checks failed
EVAL aarch64-linux.sisko
BUILD aarch64-linux.sisko
UPLOAD aarch64-linux.sisko
DOWNLOAD aarch64-linux.sisko
CACHIX aarch64-linux.sisko
ATTIC aarch64-linux.sisko
/ test (push) Successful in 1h20m54s
Move Nginx virtual hosts to relative modules
2025-05-29 10:42:13 +02:00

37 lines
1.2 KiB
Nix

{ config, ... }:
{
environment.persistence."/persist".directories = [
config.services.immich.machine-learning.environment.MACHINE_LEARNING_CACHE_FOLDER
];
services.immich = {
enable = true;
mediaLocation = "/mnt/hd/immich";
};
# The reason for this hack is quite bad
# Before using the NixOS module Immich was installed using Docker, for this
# reason the paths of the images in the database looks like `/photos/...`
# and after migrating to the NixOS module I kept getting 404s for all the
# old pictures.
# Frankly it seems weird that it saved the absolute paths in the DB, perhaps
# it saves somewhere else the media location root and then merge the paths,
# however, nevertheless I set `mediaLocation` it didn't work
fileSystems."/photos" = {
device = "/mnt/hd/immich/";
fsType = "ext4";
options = [ "bind" ];
};
services.nginx.virtualHosts."photos.aciceri.dev" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${builtins.toString config.services.immich.port}";
proxyWebsockets = true;
};
extraConfig = ''
client_max_body_size 50000M;
'';
};
}