diff options
author | makefu <github@syntax-fehler.de> | 2023-07-28 22:24:15 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2023-07-28 22:24:15 +0200 |
commit | 060a8f28fa1fc648bdf66afb31a5d1efac868837 (patch) | |
tree | 2b354eacc7897365ee45244fe7a51720e0d0333f /makefu/2configs/stats/arafetch.nix | |
parent | cbfcc890e3b76d942b927809bf981a5fa7289e6a (diff) |
makefu: move out to own repo, add vacation-note
Diffstat (limited to 'makefu/2configs/stats/arafetch.nix')
-rw-r--r-- | makefu/2configs/stats/arafetch.nix | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/makefu/2configs/stats/arafetch.nix b/makefu/2configs/stats/arafetch.nix deleted file mode 100644 index 0ea05e779..000000000 --- a/makefu/2configs/stats/arafetch.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ pkgs, lib, ...}: -with import <stockholm/lib>; -let - pkg = with pkgs.python3Packages;buildPythonPackage rec { - rev = "56d41de8219adc"; - name = "arafetch-${rev}"; - propagatedBuildInputs = [ - requests - docopt - influxdb - beautifulsoup4 - paho-mqtt - ]; - src = pkgs.fetchgit { - url = "http://cgit.euer.krebsco.de/arafetch"; - inherit rev; - sha256 = "0hnwbmj0plynhv3h2idhrzf2zcqx3qnw6lq8zzyn9am74pmvza39"; - }; - }; - home = "/var/lib/arafetch"; -in { - users.users.arafetch = { - uid = genid "arafetch"; - inherit home; - createHome = true; - isSystemUser = true; - group = "arafetch"; - }; - users.groups.arafetch = {}; - - systemd.services.ara2mqtt = { - startAt = "05:00:00"; - after = [ "network-online.target" ]; - path = [ pkg ]; - serviceConfig = { - User = "arafetch"; - # Restart = "always"; - WorkingDirectory = home; - PrivateTmp = true; - ExecStart = pkgs.writeDash "daily-mqtt" '' - ara2mqtt db/thales-deutschland.json --cantine thales-deutschland --host localhost - ''; - }; - }; - systemd.services.arafetch = { - startAt = "Mon,Wed,Fri 09:15:00"; - wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" ]; - environment.OUTDIR = home; - path = [ pkg pkgs.git pkgs.wget ]; - serviceConfig = { - User = "arafetch"; - # Restart = "always"; - WorkingDirectory = home; - PrivateTmp = true; - ExecStart = pkgs.writeDash "start-weekrun" '' - weekrun || echo "weekrun failed!" - find $OUTDIR/db -name \*.json | while read path;do - file=''${path##*/} - cantine=''${file%%.json} - ara2influx $path --cantine $cantine --host wbob.r - done - ''; - }; - }; -} |