35 lines
861 B
Nix
35 lines
861 B
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: {
|
|
options.services.immich = {
|
|
subdomain = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "subdomain of base domain that immich will be hosted at";
|
|
default = "immich";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf (config.services.immich.enable && config.host.reverse_proxy.enable) {
|
|
host = {
|
|
reverse_proxy.subdomains.${config.services.immich.subdomain} = {
|
|
target = "http://localhost:${toString config.services.immich.port}";
|
|
|
|
websockets.enable = true;
|
|
forwardHeaders.enable = true;
|
|
|
|
extraConfig = ''
|
|
# allow large file uploads
|
|
client_max_body_size 50000M;
|
|
|
|
# set timeout
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
send_timeout 600s;
|
|
proxy_redirect off;
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|