tests/modules/home-manager: init services.yt-dlp

This commit is contained in:
Gabriel Arazas 2024-03-09 11:05:27 +08:00
parent 9748343868
commit f7b466e7f4
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 103 additions and 0 deletions

View File

@ -58,5 +58,6 @@ import nmt {
++ lib.optionals isLinux [ ++ lib.optionals isLinux [
./services/matcha ./services/matcha
./services/plover ./services/plover
./services/yt-dlp
]); ]);
} }

View File

@ -0,0 +1,33 @@
{ config, ... }:
{
services.yt-dlp = {
enable = true;
extraArgs = [
"--no-force-overwrites"
"--write-info-json"
"--embed-chapters"
"--download-archive"
"${config.xdg.userDirs.videos}/Archive"
];
jobs.art = {
urls = [
"https://www.youtube.com/@Jazza"
"https://www.youtube.com/@bobross_thejoyofpainting"
"https://www.youtube.com/@DavidRevoy"
];
startAt = "weekly";
};
};
test.stubs.yt-dlp = { };
nmt.script = ''
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-art.service
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-art.timer
'';
}

View File

@ -0,0 +1,4 @@
{
yt-dlp-basic-job = ./basic-job.nix;
yt-dlp-multiple-jobs = ./multiple-jobs.nix;
}

View File

@ -0,0 +1,65 @@
{ config, ... }:
{
services.yt-dlp = {
enable = true;
extraArgs = [
"--no-force-overwrites"
"--write-info-json"
"--embed-chapters"
"--download-archive"
"${config.xdg.userDirs.videos}/Archive"
];
jobs = {
art = {
urls = [
"https://www.youtube.com/@Jazza"
"https://www.youtube.com/@bobross_thejoyofpainting"
"https://www.youtube.com/@DavidRevoy"
];
startAt = "monthly";
};
music = {
extraArgs = [
"--extract-audio"
];
urls = [
"https://www.youtube.com/@dragonforce"
"https://www.youtube.com/channel/UCjZjUymRDAhp9c1rb0X6aww" # 500L/g
"https://www.youtube.com/channel/UCOnUfJpp-Fg8X2TnuH_JD7w" # ALAMAT
];
startAt = "daily";
};
miscellanea = {
urls = [
"https://www.youtube.com/@SabatonHistory"
"https://www.youtube.com/channel/UCUaiGrBfRCaC6pL7ZnZjWbg" # JK Brickworks
"https://www.youtube.com/channel/UCdJdEguB1F1CiYe7OEi3SBg" # JonTronShow
"https://www.youtube.com/channel/UCm9K6rby98W8JigLoZOh6FQ" # LockPickingLawyer
];
startAt = "weekly";
};
};
};
test.stubs.yt-dlp = { };
nmt.script = ''
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-art.service
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-art.timer
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-music.service
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-music.timer
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-miscellanea.service
assertFileExists home-files/.config/systemd/user/yt-dlp-archive-service-miscellanea.timer
assertPathNotExists home-files/.config/yt-dlp/config
'';
}