set up arr stack on robi

This commit is contained in:
Ingolf Wagner 2023-11-18 12:49:47 +01:00
parent b41198d7a5
commit 2c8b007e99
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
7 changed files with 135 additions and 18 deletions

View file

@ -26,7 +26,9 @@ let
"transmission2.robi" = hosts.robi; "transmission2.robi" = hosts.robi;
"sonarr.robi" = hosts.robi; "sonarr.robi" = hosts.robi;
"radarr.robi" = hosts.robi; "radarr.robi" = hosts.robi;
"tadarr.robi" = hosts.robi; "tdarr.robi" = hosts.robi;
"prowlarr.robi" = hosts.robi;
"jellyseerr.robi" = hosts.robi;
# pepe # pepe
"grafana.pepe" = hosts.pepe; "grafana.pepe" = hosts.pepe;
"loki.pepe" = hosts.pepe; "loki.pepe" = hosts.pepe;

View file

@ -15,16 +15,16 @@
series = "/media/series"; series = "/media/series";
samples = "/media/samples"; samples = "/media/samples";
}; };
custom.samba-share.private = { #custom.samba-share.private = {
media = { # media = {
folder = "/media"; # folder = "/media";
users = "media"; # users = "media";
}; # };
temp = { # temp = {
folder = "/srv/tdarr/transcode_cache"; # folder = "/srv/tdarr/transcode_cache";
users = "media"; # users = "media";
}; # };
}; #};
users.groups."media".gid = config.ids.gids.transmission; users.groups."media".gid = config.ids.gids.transmission;
users.users."media" = { users.users."media" = {

View file

@ -23,12 +23,27 @@
src = "root@robi:/var/lib/bitwarden_rs/"; src = "root@robi:/var/lib/bitwarden_rs/";
dst = "/mirror/bitwarden_rs"; dst = "/mirror/bitwarden_rs";
}; };
torrent = { #torrent = {
# sshKeyPath = config.sops.secrets.rsync_private_key.path;
# src = "root@robi:/media/torrent/downloads/";
# dst = "/media/torrent";
# startAt = "00/5:00"; # every 5 hours
#};
radarr = {
sshKeyPath = config.sops.secrets.rsync_private_key.path; sshKeyPath = config.sops.secrets.rsync_private_key.path;
src = "root@robi:/media/torrent/downloads/"; src = "root@robi:/media/arr/radarr";
dst = "/media/torrent"; dst = "/media/arr/radarr";
startAt = "00/5:00"; # every 5 hours delete = false;
}; };
sonarr = {
sshKeyPath = config.sops.secrets.rsync_private_key.path;
src = "root@robi:/media/arr/sonarr";
dst = "/media/arr/sonarr";
delete = false;
};
}; };

View file

@ -22,11 +22,12 @@
./nextcloud.nix ./nextcloud.nix
./packages.nix ./packages.nix
./taskserver.nix ./taskserver.nix
./tinc.nix
./vaultwarden.nix ./vaultwarden.nix
./nginx.nix ./nginx.nix
./nginx-wkd.nix ./nginx-wkd.nix
./wireguard.nix
./network-tinc.nix
./network-wireguard.nix
./media-share.nix ./media-share.nix
./media-jellyfin.nix ./media-jellyfin.nix
@ -34,6 +35,7 @@
./media-transmission.nix ./media-transmission.nix
./media-transmission2.nix ./media-transmission2.nix
./media-arr.nix ./media-arr.nix
./media-tdarr.nix
./social-jitsi.nix ./social-jitsi.nix

View file

@ -1,17 +1,39 @@
{ config, ... }: { config, ... }:
{ {
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 7878 8989 ];
# download series
services.sonarr = { services.sonarr = {
enable = true; enable = true;
group = "media"; group = "media";
user = "media"; user = "media";
}; };
# download movies
services.radarr = { services.radarr = {
enable = true; enable = true;
group = "media"; group = "media";
user = "media"; user = "media";
}; };
# better indexer apis
services.prowlarr = {
enable = true;
#group = "media";
#user = "media";
};
services.jellyseerr = {
enable = true;
};
services.permown."/media/arr" = {
owner = "media";
group = "media";
directory-mode = "770";
file-mode = "770";
};
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"radarr.${config.networking.hostName}.private" = { "radarr.${config.networking.hostName}.private" = {
extraConfig = '' extraConfig = ''
@ -33,6 +55,26 @@
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
"prowlarr.${config.networking.hostName}.private" = {
extraConfig = ''
allow ${config.tinc.private.subnet};
deny all;
'';
locations."/" = {
proxyPass = "http://localhost:9696";
proxyWebsockets = true;
};
};
"jellyseerr.${config.networking.hostName}.private" = {
extraConfig = ''
allow ${config.tinc.private.subnet};
deny all;
'';
locations."/" = {
proxyPass = "http://localhost:${toString config.services.jellyseerr.port}";
proxyWebsockets = true;
};
};
}; };
} }

View file

@ -0,0 +1,51 @@
{ config, lib, pkgs, ... }:
{
# https://docs.tdarr.io/docs/installation/docker/run-compose
virtualisation.oci-containers = {
containers.tdarr = {
volumes = [
"/media/arr/tdarr/server:/app/server"
"/media/arr/tdarr/configs:/app/configs"
"/media/arr/tdarr/logs:/app/logs"
"/media/arr/tdarr/transcode_cache:/temp"
"/media:/media"
];
environment = {
serverIP = "0.0.0.0";
serverPort = "8266";
webUIPort = "8265";
internalNode = "true";
inContainer = "true";
nodeName = "robi";
TZ = "Europe/Berlin";
PUID = toString config.users.users.media.uid;
PGID = toString config.users.groups.media.gid;
};
ports = [
"8265:8265" # WebUI
"8266:8266" # server port
];
image = "ghcr.io/haveagitgat/tdarr:latest"; # Warning: if the tag does not change, the image will not be updated
#extraOptions = [ "--network=bridge" ];
};
};
#networking.firewall.interfaces.wq0.allowedTCPPorts = [ 8266 ];
#networking.firewall.interfaces.wq0.allowedUDPPorts = [ 8266 ];
#networking.firewall.interfaces.enp0s31f6.allowedTCPPorts = [ 8266 ];
#networking.firewall.interfaces.enp0s31f6.allowedUDPPorts = [ 8266 ];
services.nginx.virtualHosts."tdarr.${config.networking.hostName}.private" = {
extraConfig = ''
allow ${config.tinc.private.subnet};
deny all;
'';
locations."/" = {
proxyPass = "http://localhost:8265";
proxyWebsockets = true;
};
};
}

View file

@ -19,7 +19,7 @@ let
rsync \ rsync \
--rsh=${escape ssh} \ --rsh=${escape ssh} \
--append -avz \ --append -avz \
--delete \ ${optionalString plan.delete "--delete"} \
"$rsync_src/" \ "$rsync_src/" \
"$rsync_dst" "$rsync_dst"
''; '';
@ -45,6 +45,11 @@ in
default = "hourly"; default = "hourly";
type = with types; nullOr str; # TODO systemd.time(7)'s calendar event type = with types; nullOr str; # TODO systemd.time(7)'s calendar event
}; };
delete = mkOption {
type = types.bool;
default = true;
description = "delete old files (adds the --delete argument to rsync)";
};
timerConfig = mkOption { timerConfig = mkOption {
type = with types; attrsOf str; type = with types; attrsOf str;
default = optionalAttrs (config.startAt != null) { default = optionalAttrs (config.startAt != null) {