dynamically generate archiveteam containers

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
ahuston-0 2024-06-23 15:42:33 -04:00
parent 67a337dfaf
commit a5bbb110c4
No known key found for this signature in database
GPG Key ID: 1FACF4075E3212F7
4 changed files with 138 additions and 1 deletions

View File

@ -56,7 +56,7 @@
# type:
# fileList :: Path -> String -> [Path]
fileList = dir: map (file: dir + "/${file}") (ls dir);
createContainers =
createTemplatedContainers =
containers: container-spec:
builtins.listToAttrs (
lib.flatten (
@ -70,6 +70,7 @@
)
);
# Converts an integer into a string
parseInt =
num:
let

View File

@ -7,6 +7,7 @@
{
imports = [
./attic.nix
./docker
./docker.nix
./hydra.nix
./minio.nix

View File

@ -0,0 +1,123 @@
{
config,
lib,
pkgs,
...
}:
let
containers = {
imgur = {
image = "imgur-grab";
scale = 1;
};
telegram = {
image = "telegram-grab";
scale = 3;
};
reddit = {
image = "reddit-grab";
scale = 1;
};
dpreview = {
image = "dpreview-grab";
scale = 0;
};
issuu = {
image = "issuu-grab";
scale = 0;
};
urls = {
image = "urls-grab";
scale = 2;
};
urlteam = {
image = "terroroftinytown-client-grab";
scale = 2;
};
mediafire = {
image = "mediafire-grab";
scale = 1;
};
github = {
image = "github-grab";
scale = 1;
};
lineblog = {
image = "lineblog-grab";
scale = 0;
};
banciyuan = {
image = "banciyuan-grab";
scale = 0;
};
wysp = {
image = "wysp-grab";
scale = 0;
};
xuite = {
image = "xuite-grab";
scale = 0;
};
gfycat = {
image = "gfycat-grab";
scale = 0;
};
skyblog = {
image = "skyblog-grab";
scale = 0;
};
zowa = {
image = "zowa-grab";
scale = 0;
};
blogger = {
image = "blogger-grab";
scale = 0;
};
vbox7 = {
image = "vbox7-grab";
scale = 0;
};
pastebin = {
image = "pastebin-grab";
scale = 1;
};
youtube = {
image = "youtube-grab";
scale = 1;
};
deviantart = {
image = "deviantart-grab";
scale = 1;
};
};
container-spec = container: {
image = "atdr.meo.ws/archiveteam/${container}";
extraOptions = [
"--stop-signal=SIGINT"
"--stop-timeout=1800"
];
labels = {
"com.centurylinklabs.watchtower.enable" = "true";
"com.centurylinklabs.watchtower.scope" = "archiveteam";
};
cmd = lib.splitString " " "--concurrent 6 AmAnd0";
};
in
{
virtualisation.oci-containers.containers =
(lib.rad-dev.createTemplatedContainers containers container-spec)
// {
archiveteam-watchtower = {
image = "containrrr/watchtower:latest";
labels = {
"com.centurylinklabs.watchtower.enable" = "true";
"com.centurylinklabs.watchtower.scope" = "archiveteam";
};
volumes = [ "/var/run/docker.sock:/var/run/docker.sock" ];
cmd = lib.splitString " " "--label-enable --cleanup --interval 600";
};
};
}

View File

@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ./archiveteam.nix ];
virtualisation.oci-containers.backend = "docker";
}