{ config, pkgs, lib, ... }: { imports = [ ]; c3d2 = { isInHq = false; hq.interface = "eth0"; enableHail = false; }; networking.hostName = "scrape"; networking.useNetworkd = true; # 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 ; fhemLogin = import ; matematLogin = 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"; }; scrape-luftdaten = makeService { script = "luftdaten"; host = ""; }; scrape-fhem = makeService { script = "fhem"; host = "fhem.hq.c3d2.de"; inherit (fhemLogin) user password; }; scrape-matemat = makeService { script = "matemat"; host = "matemat.hq.c3d2.de"; inherit (matematLogin) user password; }; scrape-node1139 = makeService { script = "freifunk_node"; host = "10.200.4.120"; }; scrape-node1487 = makeService { script = "freifunk_node"; host = "10.200.5.213"; }; scrape-node1247 = makeService { script = "freifunk_node"; host = "10.200.4.228"; }; scrape-node1768 = makeService { script = "freifunk_node"; host = "10.200.6.239"; }; }; 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"; }; systemd.timers.scrape-luftdaten = { partOf = [ "scrape-luftdaten.service" ]; wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = "minutely"; }; systemd.timers.scrape-fhem = { partOf = [ "scrape-fhem.service" ]; wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = "minutely"; }; systemd.timers.scrape-matemat = { partOf = [ "scrape-matemat.service" ]; wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = "minutely"; }; systemd.timers.scrape-node1139 = { partOf = [ "scrape-node1139.service" ]; wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = "minutely"; }; systemd.timers.scrape-node1487 = { partOf = [ "scrape-node1487.service" ]; wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = "minutely"; }; systemd.timers.scrape-node1247 = { partOf = [ "scrape-node1247.service" ]; wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = "minutely"; }; systemd.timers.scrape-node1768 = { partOf = [ "scrape-node1768.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 # servers. You should change this only after NixOS release notes say you # should. system.stateVersion = "20.03"; # Did you read the comment? }