59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{ config, ... }:
|
|
let
|
|
cfg = import /etc/nixos/modules/vars.nix;
|
|
sabnzbd_port = cfg.arrstack.sabnzbd.port;
|
|
outpost_port = cfg.authentik.outpostPort;
|
|
domain = "mc-fucker.cool";
|
|
in
|
|
{
|
|
|
|
virtualisation.oci-containers.containers.sabnzbd = {
|
|
image = "lscr.io/linuxserver/sabnzbd:latest";
|
|
environment = {
|
|
TZ = "Europe/Berlin";
|
|
PUID = toString config.users.users.arr.uid;
|
|
PGID = toString config.users.groups.arr.gid;
|
|
};
|
|
ports = [
|
|
"${sabnzbd_port}:8080"
|
|
];
|
|
volumes = [
|
|
"/var/lib/sabnzbd:/config"
|
|
"/mnt/mergerfs/media/usenet:/data/usenet"
|
|
"/mnt/cache/sabnzbd:/cache"
|
|
];
|
|
extraOptions = cfg.podman.extraOptions;
|
|
autoStart = false;
|
|
};
|
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
"sabnzbd.${domain}" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations =
|
|
let
|
|
common = ''
|
|
client_max_body_size 100m;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
'';
|
|
in
|
|
{
|
|
"/" = {
|
|
proxyPass = "http://127.0.0.1:${outpost_port}";
|
|
extraConfig = common;
|
|
};
|
|
"/api" = {
|
|
proxyPass = "http://127.0.0.1:${sabnzbd_port}";
|
|
extraConfig = common;
|
|
};
|
|
};
|
|
extraConfig = ''
|
|
access_log /var/log/nginx/sabnzbd.${domain}_access.log;
|
|
error_log /var/log/nginx/sabnzbd.${domain}_error.log;
|
|
'';
|
|
};
|
|
|
|
};
|
|
}
|
|
# vim: set et ts=2 sw=2 ai:
|