immich.nix 958 B

12345678910111213141516171819202122232425262728293031323334
  1. { config, ... }:
  2. let
  3. cfg = config.services.immich;
  4. domain = "photos.t5.st";
  5. in
  6. {
  7. services.immich = {
  8. enable = true;
  9. host = "127.0.0.1";
  10. mediaLocation = "/mnt/storage/immich";
  11. group = "storage";
  12. accelerationDevices = [ "/dev/dri/renderD128" ];
  13. settings = {
  14. metadata.faces.import = true;
  15. newVersionCheck.enabled = false;
  16. server.externalDomain = "https://${domain}";
  17. # TODO: add smtp authentication to environment
  18. # notifications.smtp.enabled = true;
  19. # notifications.smtp.from = "Odin Photos <[email protected]>";
  20. };
  21. };
  22. services.cloudflared.tunnels."71c89a7f-2467-444c-9fda-4864860dc8c4" = {
  23. credentialsFile =
  24. config.age.secrets."odin/services/cloudflared-tunnel".path;
  25. default = "http_status:404";
  26. ingress."${domain}".service =
  27. "http://${cfg.host}:${toString cfg.port}";
  28. };
  29. systemd.tmpfiles.rules = [
  30. "d /mnt/storage/immich 0770 immich storage - -"
  31. ];
  32. }