mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
tests/modules/home-manager: init services.gallery-dl
This commit is contained in:
parent
e3a14a4453
commit
d29a451780
@ -57,6 +57,7 @@ import nmt {
|
||||
]
|
||||
++ lib.optionals isLinux [
|
||||
./services/archivebox
|
||||
./services/gallery-dl
|
||||
./services/matcha
|
||||
./services/plover
|
||||
./services/yt-dlp
|
||||
|
32
tests/modules/home-manager/services/gallery-dl/basic-job.nix
Normal file
32
tests/modules/home-manager/services/gallery-dl/basic-job.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.gallery-dl = {
|
||||
enable = true;
|
||||
archivePath = "${config.xdg.userDirs.pictures}/gallery-dl";
|
||||
|
||||
extraArgs = [
|
||||
# Record all downloaded files in an archive file.
|
||||
"--download-archive"
|
||||
"${config.services.gallery-dl.archivePath}/photos"
|
||||
|
||||
"--date" "today-1week" # get only videos from a week ago
|
||||
"--output" "%(uploader)s/%(title)s.%(ext)s" # download them in the respective directory
|
||||
];
|
||||
|
||||
jobs.art = {
|
||||
urls = [
|
||||
"https://www.pixiv.net/en/users/60562229"
|
||||
"https://www.deviantart.com/xezeno"
|
||||
];
|
||||
startAt = "weekly";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.gallery-dl = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/gallery-dl-job-art.service
|
||||
assertFileExists home-files/.config/systemd/user/gallery-dl-job-art.timer
|
||||
'';
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
gallery-dl-basic-job = ./basic-job.nix;
|
||||
gallery-dl-multiple-jobs = ./multiple-jobs.nix;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.gallery-dl = {
|
||||
enable = true;
|
||||
archivePath = "${config.xdg.userDirs.pictures}/gallery-dl";
|
||||
|
||||
extraArgs = [
|
||||
# Record all downloaded files in an archive file.
|
||||
"--download-archive"
|
||||
"${config.services.gallery-dl.archivePath}/photos"
|
||||
|
||||
"--date" "today-1week" # get only videos from a week ago
|
||||
"--output" "%(uploader)s/%(title)s.%(ext)s" # download them in the respective directory
|
||||
];
|
||||
|
||||
jobs = {
|
||||
art = {
|
||||
urls = [
|
||||
"https://www.pixiv.net/en/users/60562229"
|
||||
"https://www.deviantart.com/xezeno"
|
||||
];
|
||||
startAt = "weekly";
|
||||
};
|
||||
|
||||
webcomics = {
|
||||
urls = [
|
||||
"https://www.webtoons.com/en/comedy/mono-and-mochi/list?title_no=6019"
|
||||
];
|
||||
startAt = "daily";
|
||||
extraArgs = [
|
||||
"--date" "today-2week" # get only videos from a week ago
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.gallery-dl = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/gallery-dl-job-art.service
|
||||
assertFileExists home-files/.config/systemd/user/gallery-dl-job-art.timer
|
||||
|
||||
assertFileExists home-files/.config/systemd/user/gallery-dl-job-webcomics.service
|
||||
assertFileExists home-files/.config/systemd/user/gallery-dl-job-webcomics.timer
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user