From 27c700767c513f4ce4c81823c95dda50e9b7d508 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Wed, 17 Apr 2024 09:56:54 -0600 Subject: [PATCH] systemd download/instagram + linting --- miniserver/configuration.org | 110 +++++++++++++++++++++++++++-------- 1 file changed, 86 insertions(+), 24 deletions(-) diff --git a/miniserver/configuration.org b/miniserver/configuration.org index f77c5e2..dc11934 100644 --- a/miniserver/configuration.org +++ b/miniserver/configuration.org @@ -404,16 +404,16 @@ Libraries & apps not found on the nix-store and scripts made by me. #+begin_src nix ]) ++ (with pkgs.python3Packages; [ -(buildPythonApplication rec { + (buildPythonApplication rec { pname = "download"; - version = "1.5"; + version = "2.5"; src = ../scripts/download/.; doCheck = false; buildInputs = [ setuptools ]; propagatedBuildInputs = - [ pyyaml types-pyyaml ]; -}) -(buildPythonApplication rec { + [ pyyaml types-pyyaml ]; + }) + (buildPythonApplication rec { pname = "ffpb"; version = "0.4.1"; src = fetchPypi { @@ -423,8 +423,8 @@ Libraries & apps not found on the nix-store and scripts made by me. doCheck = false; buildInputs = [ setuptools ]; propagatedBuildInputs = - [ tqdm ]; -}) + [ tqdm ]; + }) # (buildPythonApplication rec { # pname = "qbit_manage"; # version = "4.0.3"; @@ -806,7 +806,7 @@ in [ myPkg ]; services = { "stream@" = { description = "monitors a stream channel for online streams."; - restartIfChanged = true; + restartIfChanged = true; wantedBy = [ "default.target" ]; path = [ pkgs.nix @@ -818,6 +818,37 @@ in [ myPkg ]; ExecStart = "${jawzStream}/bin/stream-dl %I"; }; }; + "download@" = { + description = "Downloads post from multiple sources."; + restartIfChanged = true; + wantedBy = [ "default.target" ]; + path = [ + pkgs.bash + unstable.pkgs.gallery-dl + unstable.pkgs.yt-dlp + ]; + serviceConfig = { + Restart = "on-failure"; + RestartSec = 30; + ExecStart = "/etc/profiles/per-user/jawz/bin/download %I"; + }; + }; + "instagram@" = { + description = "Downloads post types from instagram."; + restartIfChanged = true; + wantedBy = [ "default.target" ]; + path = [ + pkgs.bash + unstable.pkgs.gallery-dl + unstable.pkgs.yt-dlp + ]; + serviceConfig = { + Restart = "on-failure"; + RestartSec = 30; + ExecStart = "/etc/profiles/per-user/jawz/bin/download \\ + instagram -u jawz -t %I"; + }; + }; # unpackerr = { # enable = true; # restartIfChanged = true; @@ -829,6 +860,24 @@ in [ myPkg ]; # ExecStart = "${pkgs.unpackerr}/bin/unpackerr -c /home/jawz/.config/unpackerr.conf"; # }; # }; + tuhmayto = { + enable = true; + restartIfChanged = true; + description = "Downloads tuhmayto stuff"; + wantedBy = [ "default.target" ]; + path = [ + pkgs.bash + unstable.pkgs.gallery-dl + unstable.pkgs.yt-dlp + ]; + serviceConfig = { + Restart = "on-failure"; + RestartSec = 30; + ExecStart = "/etc/profiles/per-user/jawz/bin/download \\ + -u jawz -i https://twitter.com/tuhmayto/media \\ + https://www.furaffinity.net/user/tuhmayto/"; + }; + }; manage-library = { enable = true; restartIfChanged = true; @@ -836,6 +885,7 @@ in [ myPkg ]; wantedBy = [ "default.target" ]; path = [ pkgs.nix + pkgs.sudo jawzManageLibrary ]; serviceConfig = { @@ -844,20 +894,6 @@ in [ myPkg ]; ExecStart = "${jawzManageLibrary}/bin/manage-library"; }; }; - tasks = { - restartIfChanged = true; - description = "Run a tasks script which keeps a lot of things organized"; - wantedBy = [ "default.target" ]; - path = [ - pkgs.nix - jawzTasks - ]; - serviceConfig = { - Restart = "on-failure"; - RestartSec = 30; - ExecStart = "${jawzTasks}/bin/tasks"; - }; - }; qbit_manage = let qbit_dir = "/home/jawz/Development/Git/qbit_manage"; in { restartIfChanged = true; description = "Tidy up my torrents"; @@ -884,15 +920,41 @@ in [ myPkg ]; RandomizedDelaySec = 30; }; }; + downloadTimer = time : { + enable = true; + description = "Downloads post from multiple sources."; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = time; + RandomizedDelaySec = 30; + Persistent = true; + }; + }; + instagramTimer = time : { + enable = true; + description = "Downloads post types from instagram."; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = time; + RandomizedDelaySec = 120; + Persistent = true; + }; + }; in { "stream@johnneal911" = streamTimer // { }; "stream@uk2011boy" = streamTimer // { }; "stream@tommy9x6" = streamTimer // { }; "stream@brocollirob" = streamTimer // { }; "stream@tomayto\\x20picarto" = streamTimer // { }; - tasks = { + "instagram@stories" = instagramTimer "*-*-* 08:12:00" // { }; + "download@main" = downloadTimer "*-*-* 06,18:02:00" // { }; + "download@push" = downloadTimer "*:0/5" // { }; + "download@manga" = downloadTimer "Fri *-*-* 03:08:00" // { }; + # "download@kemono" = downloadTimer + # "*-*-1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31 18:06:00" // { }; + tuhmayto = { enable = true; - description = "Run a tasks script which keeps a lot of things organized"; + description = "Downloads tuhmayto stuff"; wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = "*:0/10";