containers/scrape: setup xerox scraping

This commit is contained in:
Astro 2020-04-04 00:06:59 +02:00
parent ba38126c65
commit c38882d07e
2 changed files with 34 additions and 2 deletions

View File

@ -21,7 +21,39 @@
# Required for krops
services.openssh.enable = true;
environment.systemPackages = [ pkgs.git ];
systemd.services =
let
scrapers = import (
builtins.fetchGit { url = "https://gitea.c3d2.de/astro/scrapers.git"; }
) {
inherit pkgs;
};
makeService = { script, host, user ? "", password ? "" }: {
script = "${scrapers.${script}}/bin/${script} ${host} ${user} ${password}";
};
xeriLogin = import <secrets/hosts/scrape/xeri.nix>;
in {
scrape-xeri = makeService {
script = "xerox";
host = "xeri.hq.c3d2.de";
inherit (xeriLogin) user password;
};
scrape-roxi = makeService {
script = "xerox";
host = "roxi.hq.c3d2.de";
};
};
systemd.timers.scrape-xeri = {
partOf = [ "scrape-xeri.service" ];
wantedBy = [ "timers.target" ];
timerConfig.OnCalendar = "minutely";
};
systemd.timers.scrape-roxi = {
partOf = [ "scrape-roxi.service" ];
wantedBy = [ "timers.target" ];
timerConfig.OnCalendar = "minutely";
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database

@ -1 +1 @@
Subproject commit 812dec2ee93dc6f2f03fe764a196067f81449314
Subproject commit 933f77d2e76d7b1cdc50807d3843736eac0efce0