2024-11-04 10:00:41 +01:00
|
|
|
{ config, ... }:
|
|
|
|
|
let
|
|
|
|
|
cfg = import /etc/nixos/modules/vars.nix;
|
|
|
|
|
sonarr_port = cfg.arrstack.sonarr.port;
|
|
|
|
|
outpost_port = cfg.authentik.outpostPort;
|
|
|
|
|
domain = "mc-fucker.cool";
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers.sonarr = {
|
|
|
|
|
image = "lscr.io/linuxserver/sonarr:develop";
|
|
|
|
|
environment = {
|
|
|
|
|
TZ = "Europe/Berlin";
|
|
|
|
|
PUID = toString config.users.users.arr.uid;
|
|
|
|
|
PGID = toString config.users.groups.arr.gid;
|
|
|
|
|
};
|
|
|
|
|
ports = [
|
|
|
|
|
"${sonarr_port}:${sonarr_port}"
|
|
|
|
|
];
|
|
|
|
|
volumes = [
|
|
|
|
|
"/var/lib/sonarr:/config"
|
|
|
|
|
"/mnt/mergerfs/media:/data"
|
2025-11-10 14:18:35 +01:00
|
|
|
#"/mnt/ultracc/downloads:/mnt/ultracc"
|
2024-11-04 10:00:41 +01:00
|
|
|
];
|
|
|
|
|
extraOptions = cfg.podman.extraOptions;
|
|
|
|
|
autoStart = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
|
|
|
|
|
|
"sonarr.${domain}" = {
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
enableACME = true;
|
|
|
|
|
locations =
|
|
|
|
|
let
|
|
|
|
|
common = ''
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection $http_connection;
|
|
|
|
|
proxy_redirect off;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
'';
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
"/" = {
|
|
|
|
|
proxyPass = "http://127.0.0.1:${outpost_port}";
|
|
|
|
|
extraConfig = common;
|
|
|
|
|
};
|
|
|
|
|
"/api" = {
|
|
|
|
|
proxyPass = "http://127.0.0.1:${sonarr_port}";
|
|
|
|
|
extraConfig = common;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
extraConfig = ''
|
2025-11-10 14:18:35 +01:00
|
|
|
access_log /var/log/nginx/sonarr.${domain}_access.log;
|
|
|
|
|
error_log /var/log/nginx/sonarr.${domain}_error.log;
|
|
|
|
|
send_timeout 100m;
|
|
|
|
|
proxy_connect_timeout 600;
|
|
|
|
|
proxy_send_timeout 600;
|
|
|
|
|
proxy_read_timeout 30m;
|
2024-11-04 10:00:41 +01:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
# vim: set et ts=2 sw=2 ai:
|