nixfleet/modules/immich/default.nix
Andrea Ciceri 65299f9f1f
All checks were successful
/ test (push) Successful in -19s
Migrate Immich from Docker to the NixOS module
2025-04-30 23:00:40 +02:00

25 lines
873 B
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" ];
};
}