{
  lib,
  pkgs,
  ...
}:
with lib; {
  services = {
    nginx = {
      virtualHosts."photos.posixlycorrect.com" = {
        enableACME = true;
        forceSSL = true;
        extraConfig = ''
          proxy_headers_hash_max_size 512;
          proxy_headers_hash_bucket_size 128;
        '';
        locations."/" = {
          proxyPass = "http://localhost:2283";
        };
      };
    };

    immich = {
      enable = true;
      secretsFile = "/var/trust/immich/secrets.txt";
      mediaLocation = "/mnt/export2178/immich/media";
      machine-learning.enable = false;
      environment = {
        IMMICH_TELEMETRY_EXCLUDE = "host,api,io,repo,job";
      };
      settings = {
        machineLearning = {
          enabled = false;
        };
        job = {
          backgroundTask = {
            concurrency = 1;
          };
          smartSearch = {
            concurrency = 1;
          };
          metadataExtraction = {
            concurrency = 1;
          };
          faceDetection = {
            concurrency = 1;
          };
          search = {
            concurrency = 1;
          };
          sidecar = {
            concurrency = 1;
          };
          library = {
            concurrency = 1;
          };
          migration = {
            concurrency = 1;
          };
          thumbnailGeneration = {
            concurrency = 1;
          };
          videoConversion = {
            concurrency = 1;
          };
          notifications = {
            concurrency = 1;
          };
        };
      };
    };
  };
}
