diff --git a/hosts/containers/scrape/configuration.nix b/hosts/containers/scrape/configuration.nix index 1dff75d8..1eb89d9b 100644 --- a/hosts/containers/scrape/configuration.nix +++ b/hosts/containers/scrape/configuration.nix @@ -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 ; + 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 diff --git a/secrets b/secrets index 812dec2e..933f77d2 160000 --- a/secrets +++ b/secrets @@ -1 +1 @@ -Subproject commit 812dec2ee93dc6f2f03fe764a196067f81449314 +Subproject commit 933f77d2e76d7b1cdc50807d3843736eac0efce0