From f5c48b41faf67edb9fc23f1b3ba7f21cb532d02f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:19:42 -0500 Subject: [PATCH] immich proxy --- modules/nixos/services/default.nix | 1 + modules/nixos/services/immich-proxy.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 modules/nixos/services/immich-proxy.nix diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix index 0e1d2e9..e0acad3 100644 --- a/modules/nixos/services/default.nix +++ b/modules/nixos/services/default.nix @@ -16,6 +16,7 @@ ./cloudflare.nix ./filebrowser.nix ./identity.nix + ./immich-proxy.nix ./immich.nix ./irc.nix ./gitea-runner.nix diff --git a/modules/nixos/services/immich-proxy.nix b/modules/nixos/services/immich-proxy.nix new file mode 100644 index 0000000..30442d7 --- /dev/null +++ b/modules/nixos/services/immich-proxy.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: + +{ + + options = { + immich-proxy.enable = lib.mkEnableOption "Immich proxy"; + }; + + config = lib.mkIf config.services.immich-proxy.enable { + caddy.routes = [ + { + match = [ { host = [ config.hostnames.photosProxy ]; } ]; + handle = [ + { + handler = "reverse_proxy"; + upstreams = [ { dial = "${config.hostnames.photosBackend}:443"; } ]; + } + ]; + } + ]; + }; + +}