summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/stats/arafetch.nix
blob: e04b12f9c20022e879bafaa37de14e007e70d7f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs, lib, ...}:
with import <stockholm/lib>;
let
  pkg = with pkgs.python3Packages;buildPythonPackage rec {
    rev = "762d747";
    name = "europastats-${rev}";
    propagatedBuildInputs = [
      requests
      docopt
      influxdb
      beautifulsoup4
    ];
    src = pkgs.fetchgit {
      url = "http://cgit.euer.krebsco.de/arafetch";
      inherit rev;
      sha256 = "164xiqbrr914lz0nh3i1dxz8iwg6vm2af3i3803cd3242nznw0ws";
    };
  };
  home = "/var/lib/arafetch";
in {
  users.users.arafetch = {
    uid = genid "arafetch";
    inherit home;
    createHome = true;
  };

  systemd.services.arafetch = {
    startAt = "Mon 09:15:00";
    wantedBy = [ "multi-user.target" ];
    environment = {
      OUTDIR = home;
    };
    path = [ pkg  pkgs.git pkgs.wget ];
    script = "${pkg}/bin/weekrun";
  };
}