added *arr stack

This commit is contained in:
mc-fucker 2023-04-29 20:33:25 +02:00
parent 0892a907b9
commit ee051ad103
2 changed files with 146 additions and 1 deletions

133
modules/arrstack.nix Normal file
View file

@ -0,0 +1,133 @@
{ ... }:
let
cfg = import ./vars.nix;
radarr_port = cfg.arrstack.radarr.port;
sonarr_port = cfg.arrstack.sonarr.port;
sabnzbd_port = cfg.arrstack.sabnzbd.port;
domain = "mc-fucker.cool";
in
{
#container config
virtualisation.oci-containers.containers.radarr = {
image = "lscr.io/linuxserver/radarr:latest";
environment = {
TZ = "Europe/Berlin";
};
ports = [
"${radarr_port}:7878"
];
volumes = [
"/var/lib/radarr:/config"
"/mnt/arrstack:/data"
];
extraOptions = cfg.podman.extraOptions;
};
virtualisation.oci-containers.containers.sonarr = {
image = "lscr.io/linuxserver/sonarr:latest";
environment = {
TZ = "Europe/Berlin";
};
ports = [
"${sonarr_port}:8989"
];
volumes = [
"/var/lib/sonarr:/config"
"/mnt/arrstack:/data"
];
extraOptions = cfg.podman.extraOptions;
};
virtualisation.oci-containers.containers.sabnzbd = {
image = "lscr.io/linuxserver/sabnzbd:latest";
environment = {
TZ = "Europe/Berlin";
};
ports = [
"${sabnzbd_port}:8080"
];
volumes = [
"/var/lib/sabnzbd:/config"
"/mnt/arrstack/usenet:/data/usenet"
];
extraOptions = cfg.podman.extraOptions;
};
#webserver config
imports = [ ./nginx.nix ];
services.nginx.virtualHosts = {
"radarr.${domain}" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:${radarr_port}";
extraConfig = ''
#proxy_set_header Host $proxy_host;
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;
access_log /var/log/nginx/radarr.${domain}_access.log;
error_log /var/log/nginx/radarr.${domain}_error.log;
'';
};
};
};
"sonarr.${domain}" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:${sonarr_port}";
extraConfig = ''
#proxy_set_header Host $proxy_host;
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;
access_log /var/log/nginx/sonarr.${domain}_access.log;
error_log /var/log/nginx/sonarr.${domain}_error.log;
'';
};
};
};
"sabnzbd.${domain}" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:${sabnzbd_port}";
extraConfig = ''
# proxy_set_header Host $proxy_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;
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:

View file

@ -1,9 +1,21 @@
{
arrstack = {
radarr = {
port = "7878";
};
sonarr = {
port = "8989";
};
sabnzbd = {
port = "9191";
};
};
bookstack = {
db = "bookstack";
domain = "docs.mc-fucker.cool";
port = "8989";
port = "8086";
};
ihatemoney = {