Files
nix-dotfiles/systems/palatine-hill/docker/archiveteam.nix
T

153 lines
3.4 KiB
Nix
Raw Normal View History

2024-06-23 15:42:33 -04:00
{
config,
lib,
pkgs,
...
}:
let
containers = {
archiveteam-imgur = {
2024-06-23 15:42:33 -04:00
image = "imgur-grab";
scale = 1;
};
2024-06-23 15:54:33 -04:00
archiveteam-telegram = {
image = "telegram-grab";
scale = 3;
};
archiveteam-reddit = {
image = "reddit-grab";
2024-08-17 22:03:41 -04:00
scale = 0;
2024-06-23 15:54:33 -04:00
};
archiveteam-dpreview = {
image = "dpreview-grab";
scale = 0;
};
archiveteam-issuu = {
image = "issuu-grab";
scale = 0;
};
archiveteam-urls = {
image = "urls-grab";
scale = 2;
};
archiveteam-urlteam = {
image = "terroroftinytown-client-grab";
scale = 2;
};
archiveteam-mediafire = {
image = "mediafire-grab";
scale = 1;
};
archiveteam-github = {
image = "github-grab";
scale = 1;
};
archiveteam-lineblog = {
image = "lineblog-grab";
scale = 0;
};
archiveteam-banciyuan = {
image = "banciyuan-grab";
scale = 0;
};
archiveteam-wysp = {
image = "wysp-grab";
scale = 0;
};
archiveteam-xuite = {
image = "xuite-grab";
scale = 0;
};
archiveteam-gfycat = {
image = "gfycat-grab";
scale = 0;
};
archiveteam-skyblog = {
image = "skyblog-grab";
scale = 0;
};
archiveteam-zowa = {
image = "zowa-grab";
scale = 0;
};
archiveteam-blogger = {
image = "blogger-grab";
2024-11-02 23:59:38 -04:00
scale = 1;
2024-06-23 15:54:33 -04:00
};
archiveteam-vbox7 = {
image = "vbox7-grab";
scale = 0;
};
archiveteam-pastebin = {
image = "pastebin-grab";
scale = 1;
};
archiveteam-youtube = {
image = "youtube-grab";
2024-11-28 13:15:39 -05:00
scale = 0;
2024-06-23 15:54:33 -04:00
};
archiveteam-deviantart = {
image = "deviantart-grab";
2024-08-17 22:03:41 -04:00
scale = 0;
2024-06-23 15:54:33 -04:00
};
archiveteam-postnews = {
image = "postnews-grab";
2024-08-17 22:03:41 -04:00
scale = 0;
2024-06-23 15:54:33 -04:00
};
2024-11-17 21:08:33 -05:00
archiveteam-askfm = {
image = "askfm-grab";
scale = 1;
};
archiveteam-mangz = {
image = "mangaz-grab";
scale = 1;
};
archiveteam-cohost = {
image = "cohost-grab";
scale = 1;
};
2024-06-23 15:42:33 -04:00
};
2024-06-23 15:54:33 -04:00
container-spec = container-name: container: {
2024-11-02 23:59:38 -04:00
image = "atdr.meo.ws/archiveteam/${container}:latest";
2024-08-16 00:46:47 -04:00
extraOptions = [
"--stop-signal=SIGINT"
];
2024-06-23 15:42:33 -04:00
labels = {
"com.centurylinklabs.watchtower.enable" = "true";
"com.centurylinklabs.watchtower.scope" = "archiveteam";
};
volumes = [ "${at_path}/${container-name}:/grab/data" ];
2024-06-22 02:00:25 -04:00
log-driver = "local";
2024-06-23 15:42:33 -04:00
cmd = lib.splitString " " "--concurrent 6 AmAnd0";
};
2025-04-01 13:59:09 -04:00
inherit (lib.adev.container-utils) createTemplatedContainers;
vars = import ../vars.nix;
at_path = vars.primary_archiveteam;
2024-06-23 15:42:33 -04:00
in
{
2024-11-17 22:15:39 -05:00
virtualisation.oci-containers.containers = createTemplatedContainers containers container-spec;
systemd = {
timers."custom-watchtower@archiveteam" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "20m";
OnUnitActiveSec = "5m";
Unit = "custom-watchtower@archiveteam.service";
2024-06-23 15:42:33 -04:00
};
};
2024-11-17 22:15:39 -05:00
services."custom-watchtower@archiveteam" = {
bindsTo = [ "docker.service" ];
after = [ "docker.service" ];
2024-11-28 13:15:39 -05:00
description = "a watchtower-esque script for systemd-based oci-containers";
2024-11-17 22:15:39 -05:00
serviceConfig = {
Type = "oneshot";
User = "root";
ExecStart = "${config.nix.package}/bin/nix ${./watchtower.bash} 'com.centurylinklabs.watchtower.scope' 'archiveteam'";
};
};
};
2024-06-23 15:42:33 -04:00
}