diff --git a/server/configuration.org b/server/configuration.org index 08bf5f8..a8161b5 100644 --- a/server/configuration.org +++ b/server/configuration.org @@ -49,6 +49,8 @@ let "tasks" (builtins.readFile ../scripts/tasks.sh); jawzSubs = pkgs.writeScriptBin "sub-sync" (builtins.readFile ../scripts/sub-sync.sh); + jawzChat = pkgs.writeScriptBin + "chat-dl" (builtins.readFile ../scripts/chat-dl.sh); in { # Remember to close this bracket at the end of the document #+end_src @@ -364,9 +366,9 @@ Here I compile my own scripts into binaries jawzManageLibrary jawzTasks jawzSubs +jawzChat (writeScriptBin "ffmpeg4discord" (builtins.readFile ../scripts/ffmpeg4discord.py)) (writeScriptBin "ffmpreg" (builtins.readFile ../scripts/ffmpreg.sh)) -(writeScriptBin "chat-dl" (builtins.readFile ../scripts/chat-dl.sh)) (writeScriptBin "picarto-dl" (builtins.readFile ../scripts/picarto-dl.sh)) (writeScriptBin "split-dir" (builtins.readFile ../scripts/split-dir.sh)) (writeScriptBin "pika-list" (builtins.readFile ../scripts/pika-list.sh)) @@ -910,7 +912,38 @@ in [ myPkg ]; # }; }; user = { - services = { + services = let + chatService = channel: { + description = "monitors a chaturbate channel for online streams."; + restartIfChanged = true; + wantedBy = [ "default.target" ]; + path = [ + pkgs.nix + jawzChat + ]; + serviceConfig = { + Restart = "on-failure"; + RestartSec = 30; + ExecStart = "${jawzChat}/bin/chat-dl ${channel}"; + }; + }; + in { + "chat@" = { + description = "monitors a chaturbate channel for online streams."; + restartIfChanged = true; + wantedBy = [ "default.target" ]; + path = [ + pkgs.nix + jawzChat + ]; + serviceConfig = { + Restart = "on-failure"; + RestartSec = 30; + ExecStart = "${jawzChat}/bin/chat-dl %I"; + }; + }; + "chat-johnneal911" = chatService "johnneal911" // { }; + "chat-uk2011boy" = chatService "uk2011boy" // { }; # HentaiAtHome = { # enable = true; # restartIfChanged = true; @@ -980,7 +1013,20 @@ in [ myPkg ]; # }; # }; }; - timers = { + timers = let + chatTimer = { + enable = true; + description = "monitors a chaturbate channel for online streams."; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "5min"; + OnUnitActiveSec = "65min"; + RandomizedDelaySec = 30; + }; + }; + in { + "chat-johnneal911" = chatTimer // { }; + "chat-uk2011boy" = chatTimer // { }; # tasks = { # enable = true; # description = "Run a tasks script which keeps a lot of things organized";