tests/modules/home-manager: init services.archivebox

This commit is contained in:
Gabriel Arazas 2024-03-09 11:24:20 +08:00
parent a42c588402
commit e3a14a4453
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
5 changed files with 109 additions and 0 deletions

View File

@ -56,6 +56,7 @@ import nmt {
./programs/pop-launcher
]
++ lib.optionals isLinux [
./services/archivebox
./services/matcha
./services/plover
./services/yt-dlp

View File

@ -0,0 +1,23 @@
{ config, ... }:
{
services.archivebox = {
enable = true;
archivePath = "${config.xdg.userDirs.documents}/ArchiveBox";
jobs.art = {
links = [
"https://www.davidrevoy.com/"
"https://www.youtube.com/c/ronillust"
];
startAt = "weekly";
};
};
test.stubs.archivebox = { };
nmt.script = ''
assertFileExists home-files/.config/systemd/user/archivebox-job-art.service
assertFileExists home-files/.config/systemd/user/archivebox-job-art.timer
'';
}

View File

@ -0,0 +1,5 @@
{
archivebox-basic-job = ./basic-job.nix;
archivebox-multiple-jobs = ./multiple-jobs.nix;
archivebox-webserver = ./webserver.nix;
}

View File

@ -0,0 +1,50 @@
{ config, ... }:
{
services.archivebox = {
enable = true;
archivePath = "${config.xdg.userDirs.documents}/ArchiveBox";
jobs = {
art = {
links = [
"https://www.davidrevoy.com/"
"https://www.youtube.com/c/ronillust"
];
startAt = "weekly";
};
research = {
links = [
"https://arxiv.org/rss/cs"
"https://distill.pub/"
];
extraArgs = [ "--depth" "1" ];
startAt = "daily";
};
tech = {
links = [
"https://thisweek.gnome.org/index.xml"
"https://pointieststick.com/feed"
"https://planet.gnome.org/atom.xml"
"https://planet.kde.org/atom.xml"
];
startAt = "daily";
};
};
};
test.stubs.archivebox = { };
nmt.script = ''
assertFileExists home-files/.config/systemd/user/archivebox-job-art.service
assertFileExists home-files/.config/systemd/user/archivebox-job-art.timer
assertFileExists home-files/.config/systemd/user/archivebox-job-research.service
assertFileExists home-files/.config/systemd/user/archivebox-job-research.timer
assertFileExists home-files/.config/systemd/user/archivebox-job-tech.service
assertFileExists home-files/.config/systemd/user/archivebox-job-tech.timer
'';
}

View File

@ -0,0 +1,30 @@
{ config, ... }:
{
services.archivebox = {
enable = true;
archivePath = "${config.xdg.userDirs.documents}/ArchiveBox";
jobs.art = {
links = [
"https://www.davidrevoy.com/"
"https://www.youtube.com/c/ronillust"
];
startAt = "weekly";
};
webserver = {
enable = true;
port = 8888;
};
};
test.stubs.archivebox = { };
nmt.script = ''
assertFileExists home-files/.config/systemd/user/archivebox-job-art.service
assertFileExists home-files/.config/systemd/user/archivebox-job-art.timer
assertFileExists home-files/.config/systemd/user/archivebox-server.service
'';
}