2020-04-03 22:49:45 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
<nixpkgs/nixos/modules/profiles/minimal.nix>
|
|
|
|
<lib>
|
|
|
|
<lib/lxc-container.nix>
|
|
|
|
<lib/shared.nix>
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
2020-04-04 00:06:59 +02:00
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
2020-04-03 22:49:45 +02:00
|
|
|
|
|
|
|
# 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?
|
|
|
|
}
|