immich.nix 862 B

1234567891011121314151617181920212223242526272829303132
  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. server.externalDomain = "https://${domain}";
  16. notifications.smtp.enabled = true;
  17. notifications.smtp.from = "Odin Photos <[email protected]>";
  18. };
  19. };
  20. services.cloudflared.tunnels."71c89a7f-2467-444c-9fda-4864860dc8c4" = {
  21. credentialsFile =
  22. config.age.secrets."odin/services/cloudflared-tunnel".path;
  23. default = "http_status:404";
  24. ingress."${domain}".service =
  25. "http://${cfg.host}:${toString cfg.port}";
  26. };
  27. systemd.tmpfiles.rules = [
  28. "d /mnt/storage/immich 0770 immich storage - -"
  29. ];
  30. }