servarr: added rdtclient

This commit is contained in:
Tigor Hutasuhut 2024-06-26 19:25:28 +07:00
parent a772664b8e
commit 7997bca8f0
5 changed files with 75 additions and 14 deletions

View file

@ -43,6 +43,10 @@ in
type = types.bool;
default = config.profile.podman.servarr.enable;
};
rdtclient.enable = mkOption {
type = types.bool;
default = config.profile.podman.servarr.enable;
};
};
};
}

View file

@ -33,6 +33,8 @@
qbittorrent.enable = true;
servarr.enable = true;
servarr.recyclarr.enable = false;
servarr.real-debrid-manager.enable = false;
servarr.rdtclient.enable = true;
};
docker = {

View file

@ -1,11 +1,12 @@
{ ... }:
{
imports = [
# ./real-debrid-manager.nix
./real-debrid-manager.nix
./qbittorrent.nix
./sonarr.nix
./prowlarr.nix
./bazarr.nix
./radarr.nix
./rdtclient.nix
];
}

View file

@ -0,0 +1,51 @@
{ config, lib, ... }:
let
podman = config.profile.podman;
name = "rdtclient";
cfg = podman.servarr.${name};
ip = "10.88.2.1";
image = "docker.io/rogerfar/rdtclient:latest";
root = "/nas/mediaserver/servarr";
volumeConfig = "${root}/${name}";
mediaVolume = "${root}/data/torrents";
domain = "${name}.tigor.web.id";
user = config.profile.user;
uid = toString user.uid;
gid = toString user.gid;
inherit (lib) mkIf;
in
{
config = mkIf (podman.enable && cfg.enable) {
services.caddy.virtualHosts.${domain}.extraConfig = ''
reverse_proxy ${ip}:6500
'';
system.activationScripts."podman-${name}" = ''
mkdir -p ${volumeConfig} ${mediaVolume}
chown ${uid}:${gid} ${volumeConfig} ${mediaVolume}
'';
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
# user = "${uid}:${gid}";
environment = {
TZ = "Asia/Jakarta";
PUID = uid;
PGID = gid;
};
volumes = [
"${volumeConfig}:/data/db"
"${mediaVolume}:/data/torrents"
];
extraOptions = [
"--network=podman"
"--ip=${ip}"
];
labels = {
"io.containers.autoupdate" = "registry";
};
};
};
}

View file

@ -1,26 +1,29 @@
{ config, lib, ... }:
let
podman = config.profile.podman;
cfg = podman.servarr.real-debrid-manager;
name = "real-debrid-manager";
ip = "10.88.2.1";
image = "docker.io/hyperbunny77/realdebridmanager:latest";
volume = "/nas/mediaserver/servarr/real-debrid-manager";
domain = "rdm.tigor.web.id";
real-debrid-manager = podman.servarr.${name};
ip = "10.88.2.99";
image = "docker.io/hyperbunny77/realdebridmanager:2022.06.27";
root = "/nas/mediaserver/servarr";
configVolume = "${root}/real-debrid-manager";
mediaVolume = "${root}/data/torrents";
watchVolume = "${mediaVolume}/watch";
domain = "${name}.tigor.web.id";
user = config.profile.user;
uid = toString user.uid;
gid = toString user.gid;
inherit (lib) mkIf;
in
{
config = mkIf (podman.enable && cfg.enable) {
services.caddy.${domain}.extraConfig = ''
config = mkIf (podman.enable && real-debrid-manager.enable) {
services.caddy.virtualHosts.${domain}.extraConfig = ''
reverse_proxy ${ip}:5000
'';
system.activationScripts."podman-${name}" = ''
mkdir -p ${volume}/{config,downloads,watch}
chown -R ${uid}:${gid} ${volume}/{config,downloads,watch}
mkdir -p ${configVolume} ${mediaVolume} ${watchVolume}
chown ${uid}:${gid} ${configVolume} ${mediaVolume} ${watchVolume}
'';
virtualisation.oci-containers.containers.${name} = {
@ -28,14 +31,14 @@ in
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
enviroment = {
environment = {
TZ = "Asia/Jakarta";
rdmport = "5000";
};
volumes = [
"${volume}/config:/config"
"${volume}/downloads:/downloads"
"${volume}/watch:/watch"
"${configVolume}:/config"
"${mediaVolume}:/data/torrents"
"${watchVolume}:/watch"
];
extraOptions = [
"--network=podman"