photoprism: move userdata mounts to /var/lib

This commit is contained in:
Motiejus Jakštys 2024-08-02 16:42:17 +03:00
parent abdf9d20e1
commit fb349648ae

View File

@ -13,16 +13,17 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.photoprism = { services.photoprism = {
enable = true; enable = true;
originalsPath = "/run/photoprism/userdata"; originalsPath = "/var/cache/photoprism/userdata";
passwordFile = cfg.passwordFile; passwordFile = cfg.passwordFile;
}; };
systemd = { systemd = {
tmpfiles.rules = [ "d /run/photoprism/userdata 0700 photoprism photoprism -" ]; tmpfiles.rules = [ "d /var/cache/photoprism/userdata 0700 photoprism photoprism -" ];
services.photoprism.serviceConfig = { services.photoprism.serviceConfig = {
ProtectHome = lib.mkForce "tmpfs"; ProtectHome = lib.mkForce "tmpfs";
CacheDirectory = "photoprism";
BindPaths = lib.mapAttrsToList ( BindPaths = lib.mapAttrsToList (
name: srcpath: "${srcpath}:/run/photoprism/userdata/${name}" name: srcpath: "${srcpath}:/var/cache/photoprism/userdata/${name}"
) cfg.paths; ) cfg.paths;
}; };
}; };