sonarr: added anime instance

This commit is contained in:
Tigor Hutasuhut 2024-06-26 13:26:32 +07:00
parent 258e7dcf88
commit 92cb15265c

View file

@ -3,12 +3,16 @@ let
podman = config.profile.podman; podman = config.profile.podman;
sonarr = podman.servarr.sonarr; sonarr = podman.servarr.sonarr;
name = "sonarr"; name = "sonarr";
name-anime = "${name}-anime";
ip = "10.88.2.3"; ip = "10.88.2.3";
ip-anime = "10.88.2.33";
image = "lscr.io/linuxserver/sonarr:latest"; image = "lscr.io/linuxserver/sonarr:latest";
root = "/nas/mediaserver/servarr"; root = "/nas/mediaserver/servarr";
configVolume = "${root}/sonarr"; configVolume = "${root}/${name}";
configVolumeAnime = "${root}/${name-anime}";
mediaVolume = "${root}/data"; mediaVolume = "${root}/data";
domain = "${name}.tigor.web.id"; domain = "${name}.tigor.web.id";
domain-anime = "${name-anime}.tigor.web.id";
user = config.profile.user; user = config.profile.user;
uid = toString user.uid; uid = toString user.uid;
gid = toString user.gid; gid = toString user.gid;
@ -20,9 +24,13 @@ in
reverse_proxy ${ip}:8989 reverse_proxy ${ip}:8989
''; '';
services.caddy.virtualHosts.${domain-anime}.extraConfig = ''
reverse_proxy ${ip-anime}:8989
'';
system.activationScripts."podman-${name}" = '' system.activationScripts."podman-${name}" = ''
mkdir -p ${configVolume} ${mediaVolume} mkdir -p ${configVolume} ${mediaVolume} ${configVolumeAnime}
chown ${uid}:${gid} ${mediaVolume} ${configVolume} chown ${uid}:${gid} ${mediaVolume} ${configVolume} ${configVolumeAnime}
''; '';
virtualisation.oci-containers.containers.${name} = { virtualisation.oci-containers.containers.${name} = {
@ -46,5 +54,27 @@ in
"io.containers.autoupdate" = "registry"; "io.containers.autoupdate" = "registry";
}; };
}; };
virtualisation.oci-containers.containers.${name-anime} = {
inherit image;
hostname = name-anime;
autoStart = true;
environment = {
PUID = uid;
PGID = gid;
TZ = "Asia/Jakarta";
};
volumes = [
"${configVolumeAnime}:/config"
"${mediaVolume}:/data"
];
extraOptions = [
"--ip=${ip-anime}"
"--network=podman"
];
labels = {
"io.containers.autoupdate" = "registry";
};
};
}; };
} }