download manga modilarized to run on diff hosts

This commit is contained in:
Danilo Reyes 2024-10-24 12:29:15 -06:00
parent 9683177062
commit 75747a8184
4 changed files with 34 additions and 12 deletions

View File

@ -23,6 +23,7 @@
};
units = {
download.enable = true;
downloadManga.enable = false;
stream-dl.enable = true;
};
scripts = {

View File

@ -24,6 +24,11 @@
ffmpeg4discord.enable = true;
manage-library.enable = true;
};
units = {
download.enable = false;
downloadManga.enable = false;
stream-dl.enable = false;
};
servers = {
sonarr.enable = true;
radarr.enable = true;

View File

@ -8,5 +8,6 @@
in
map (file: ./scripts/${file}) scriptFiles;
my.units.download.enable = lib.mkDefault false;
my.units.downloadManga.enable = lib.mkDefault false;
my.units.stream-dl.enable = lib.mkDefault false;
}

View File

@ -6,7 +6,10 @@
}:
{
imports = [ ./base.nix ];
options.my.units.download.enable = lib.mkEnableOption "enable";
options.my.units = {
download.enable = lib.mkEnableOption "enable";
downloadManga.enable = lib.mkEnableOption "enable";
};
config =
let
download =
@ -45,7 +48,7 @@
'';
};
};
systemd.user = lib.mkIf config.my.units.download.enable {
systemd.user = {
services =
let
mkDownloadService = desc: execStartCmd: {
@ -66,11 +69,17 @@
};
in
{
tuhmayto = mkDownloadService "tuhmayto stuff" ''
-u jawz -i https://x.com/tuhmayto/media \
https://www.furaffinity.net/user/tuhmayto/'';
"download@" = mkDownloadService "post from multiple sources" "%I";
"instagram@" = mkDownloadService "post types from instagram" "instagram -u jawz -t %I";
tuhmayto = lib.mkIf config.my.units.download.enable (
mkDownloadService "tuhmayto stuff" ''
-u jawz -i https://x.com/tuhmayto/media \
https://www.furaffinity.net/user/tuhmayto/''
);
"download@" = lib.mkIf (config.my.units.download.enable || config.my.units.downloadManga.enable) (
mkDownloadService "post from multiple sources" "%I"
);
"instagram@" = lib.mkIf config.my.units.download.enable (
mkDownloadService "post types from instagram" "instagram -u jawz -t %I"
);
};
timers =
let
@ -86,13 +95,19 @@
};
in
{
"instagram@stories" = downloadTimer "*-*-* 08:12:00" 120 // { };
"download@main" = downloadTimer "*-*-* 06,18:02:00" 30 // { };
"download@push" = downloadTimer "*:0/5" 30 // { };
"download@manga" = downloadTimer "Fri *-*-* 03:08:00" 30 // { };
"instagram@stories" = lib.mkIf config.my.units.download.enable (
downloadTimer "*-*-* 08:12:00" 120 // { }
);
"download@main" = lib.mkIf config.my.units.download.enable (
downloadTimer "*-*-* 06,18:02:00" 30 // { }
);
"download@push" = lib.mkIf config.my.units.download.enable (downloadTimer "*:0/5" 30 // { });
"download@manga" = lib.mkIf config.my.units.downloadManga.enable (
downloadTimer "Mon,Fri *-*-* 03:08:00" 30 // { }
);
# "download@kemono" = downloadTimer
# "*-*-1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31 18:06:00" 60 // { };
tuhmayto = {
tuhmayto = lib.mkIf config.my.units.download.enable {
enable = true;
description = "Downloads tuhmayto stuff";
wantedBy = [ "timers.target" ];