update media polling services

This commit is contained in:
Ingolf Wagner 2023-08-03 11:50:39 +02:00
parent 971ad73195
commit 95e908cb1d
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
5 changed files with 61 additions and 47 deletions

View file

@ -28,6 +28,7 @@
./media-tdarr.nix ./media-tdarr.nix
./media-jellyfin.nix ./media-jellyfin.nix
./media-youtube.nix ./media-youtube.nix
./media-castget.nix
# logging # logging
./loki.nix ./loki.nix

View file

@ -0,0 +1,24 @@
{ config, lib, ... }:
let
home = "/media/podcasts";
in
{
custom.services.castget = {
enable = true;
user = "media";
feeds = {
Alternativlos = {
url = "https://alternativlos.org/alternativlos.rss";
spool = "${home}/Alternativlos";
};
WohlstandFuerAlle = {
url = "https://wohlstandfueralle.podigee.io/feed/mp3";
spool = "${home}/Wohlstand für Alle";
};
DieNeuenZwanziger = {
url = "https://neuezwanziger.de/feed/mp3/";
spool = "${home}/Die Neuen Zwanziger";
};
};
};
}

View file

@ -92,6 +92,22 @@ let
target = "/media/youtube/series/SunkCostGalaxy"; target = "/media/youtube/series/SunkCostGalaxy";
output = "SunkCostGalaxy S01E%(playlist_index)s %(title)s.%(ext)s"; output = "SunkCostGalaxy S01E%(playlist_index)s %(title)s.%(ext)s";
}; };
MusicVideos = {
url = "https://www.youtube.com/playlist?list=PLP33x-q_GftakJgpD48pZNl0TkhljQI7S";
target = "/media/youtube/music-videos";
output = "%(title)s.%(ext)s";
};
Movies = {
url = "https://www.youtube.com/playlist?list=PLP33x-q_Gftb-r8eUWBS1mjMlQZgCAljE";
target = "/media/youtube/movies";
output = "%(title)s.%(ext)s";
};
# like Documentations or something
Videos = {
url = "https://www.youtube.com/playlist?list=PLP33x-q_GftZa0-UG9yltYLea5scEHxd7";
target = "/media/youtube/loot";
output = "%(title)s.%(ext)s";
};
}; };
downloadScript = downloadScript =

View file

@ -1,22 +0,0 @@
{ config, lib, ... }:
let
home = "/home/syncthing/podcasts";
in
{
custom.services.castget = {
enable = true;
user = "root";
feeds = {
Alternativlos = {
url = "https://alternativlos.org/alternativlos.rss";
spool = "${home}/alternativlos";
};
gegenstandpunkt = {
url = "https://pc.argudiss.de/";
spool = "${home}/GegenStandpunkt";
};
};
};
}

View file

@ -1,46 +1,42 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
with types;
let let
cfg = config.custom.services.castget; cfg = config.custom.services.castget;
in in
{ {
options.custom.services.castget = { options.custom.services.castget = {
enable = mkEnableOption "enable custom.services.castget"; enable = mkEnableOption "enable custom.services.castget";
feeds = mkOption { feeds = mkOption {
type = with types; type = attrsOf (submodule {
attrsOf (submodule { options = {
options = { url = mkOption {
url = mkOption { type = str;
type = with types; str; description = ''
description = '' url to the rss feed
url to the rss feed '';
'';
};
spool = mkOption {
type = with types; path;
description = ''
download enclosures to this directory.
'';
};
}; };
}); spool = mkOption {
type = path;
description = ''
download enclosures to this directory.
'';
};
};
});
description = '' description = ''
configurations for the cast configurations for the cast
''; '';
}; };
user = mkOption { user = mkOption {
type = with types; string; type = str;
description = '' description = ''
user to run the systemd service as user to run the systemd service as
''; '';
}; };
timerConfig = mkOption { timerConfig = mkOption {
type = with types; attrsOf str; type = attrsOf str;
default = { OnCalendar = "daily"; }; default = { OnCalendar = "daily"; };
example = { example = {
OnCalendar = "00:05"; OnCalendar = "00:05";
@ -51,7 +47,7 @@ in
''; '';
}; };
serviceName = mkOption { serviceName = mkOption {
type = with types; string; type = str;
default = "castget"; default = "castget";
description = '' description = ''
the name of the castget systemd service the name of the castget systemd service
@ -70,8 +66,7 @@ in
preStart = preStart =
let let
mkSpools = mkSpools = mapAttrsToList (ignore: value: "mkdir -p \"${value.spool}\"") cfg.feeds;
mapAttrsToList (ignore: value: "mkdir -p ${value.spool}") cfg.feeds;
in in
concatStringsSep "\n" mkSpools; concatStringsSep "\n" mkSpools;
script = script =