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"; } ]; + } + ]; + } + ]; + }; + +}