2024-06-18 19:38:41 +07:00
|
|
|
{ config, lib, ... }:
|
2024-06-17 19:54:36 +07:00
|
|
|
let
|
|
|
|
name = "suwayomi";
|
|
|
|
name-flaresolverr = "${name}-flaresolverr";
|
|
|
|
domain = "manga.tigor.web.id";
|
|
|
|
podman = config.profile.podman;
|
|
|
|
suwayomi = podman.suwayomi;
|
|
|
|
inherit (lib) mkIf;
|
2024-06-18 19:38:41 +07:00
|
|
|
ip = "10.88.0.5";
|
|
|
|
ip-flaresolverr = "10.88.0.6";
|
2024-06-17 19:54:36 +07:00
|
|
|
image = "ghcr.io/suwayomi/tachidesk:latest";
|
|
|
|
image-flaresolverr = "ghcr.io/flaresolverr/flaresolverr:latest";
|
|
|
|
volume = "/nas/podman/suwayomi";
|
|
|
|
user = config.profile.user;
|
|
|
|
uid = toString user.uid;
|
|
|
|
gid = toString user.gid;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf (podman.enable && suwayomi.enable) {
|
|
|
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
|
|
|
reverse_proxy ${ip}:4567
|
|
|
|
'';
|
|
|
|
|
|
|
|
system.activationScripts."podman-${name}" = ''
|
|
|
|
mkdir -p ${volume}
|
2024-06-18 20:24:49 +07:00
|
|
|
chown ${uid}:${gid} ${volume}
|
2024-06-17 19:54:36 +07:00
|
|
|
'';
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers.${name} = {
|
|
|
|
inherit image;
|
2024-06-18 21:00:43 +07:00
|
|
|
hostname = name;
|
2024-06-17 19:54:36 +07:00
|
|
|
autoStart = true;
|
|
|
|
user = "${uid}:${gid}";
|
|
|
|
environment = {
|
|
|
|
TZ = "Asia/Jakarta";
|
|
|
|
DOWNLOAD_AS_CBZ = "true";
|
|
|
|
AUTO_DOWNLOAD_CHAPTERS = "true";
|
|
|
|
AUTO_DOWNLOAD_EXCLUDE_UNREAD = "false";
|
|
|
|
EXTENSION_REPOS = ''["https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.min.json"]'';
|
|
|
|
MAX_SOURCES_IN_PARALLEL = "20";
|
|
|
|
UPDATE_EXCLUDE_UNREAD = "false";
|
|
|
|
UPDATE_EXCLUDE_STARTED = "false";
|
|
|
|
UPDATE_INTERVAL = "6"; # 6 Hours interval
|
|
|
|
UPDATE_MANGA_INFO = "true";
|
|
|
|
FLARESOLVERR_ENABLED = "true";
|
|
|
|
FLARESOLVERR_URL = "http://${ip-flaresolverr}:8191";
|
|
|
|
};
|
2024-10-21 12:31:30 +07:00
|
|
|
volumes = [ "${volume}:/home/suwayomi/.local/share/Tachidesk" ];
|
2024-06-17 19:54:36 +07:00
|
|
|
extraOptions = [
|
|
|
|
"--ip=${ip}"
|
2024-06-18 19:38:41 +07:00
|
|
|
"--network=podman"
|
2024-06-17 19:54:36 +07:00
|
|
|
];
|
|
|
|
dependsOn = [ "${name}-flaresolverr" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers.${name-flaresolverr} = {
|
|
|
|
image = image-flaresolverr;
|
2024-06-18 21:00:43 +07:00
|
|
|
hostname = name-flaresolverr;
|
2024-06-17 19:54:36 +07:00
|
|
|
autoStart = true;
|
|
|
|
environment = {
|
|
|
|
TZ = "Asia/Jakarta";
|
|
|
|
};
|
|
|
|
extraOptions = [
|
|
|
|
"--ip=${ip-flaresolverr}"
|
2024-06-18 19:38:41 +07:00
|
|
|
"--network=podman"
|
2024-06-17 19:54:36 +07:00
|
|
|
];
|
2024-06-19 12:49:23 +07:00
|
|
|
labels = {
|
|
|
|
"io.containers.autoupdate" = "registry";
|
|
|
|
};
|
2024-06-17 19:54:36 +07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|