nix-dotfiles/hosts/tsuki/services/scrapers/nhk-easy-news/default.nix

29 lines
810 B
Nix
Raw Normal View History

2023-07-12 01:57:20 +02:00
{ config, pkgs, lib, ... }: let
cfg = config.systemd.services.scrape-nhk-easy-news;
script = pkgs.writers.writePython3 "scrape-nhk-easy-news.py" {
libraries = with pkgs.python3Packages; [ requests wget ];
} (lib.fileContents ./script.py);
in {
systemd.services.scrape-nhk-easy-news = {
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = script;
DynamicUser = true;
PrivateTmp = true;
ProtectHome = true;
ProtectProc = "invisible";
ProtectSystem = "strict";
2024-01-23 05:24:47 +01:00
WorkingDirectory = "/data/scrapers/nhk-easy-news";
2023-07-12 01:57:20 +02:00
};
};
systemd.timers.scrape-nhk-easy-news = {
wantedBy = [ "timers.target" ];
timerConfig = {
Unit = "scrape-nhk-easy-news.service";
OnCalendar = "*-*-* 03:00:00";
};
};
}