diff options
author | lassulus <lass@blue.r> | 2018-09-18 15:47:03 +0200 |
---|---|---|
committer | lassulus <lass@blue.r> | 2018-09-18 15:47:03 +0200 |
commit | 245994cc7ace5a323c476ccc50fd4026b9353dc4 (patch) | |
tree | cf4a3d85c768bd1ca18913d17c67e07bcab95db7 /makefu/2configs/stats/external/weather2stats.nix | |
parent | 1466d3e86abc4d85af6efe5a964df788cf0e36cc (diff) | |
parent | 8a756c7333e0e7c4a0433d68775f8d7c1a53b8b0 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/stats/external/weather2stats.nix')
-rw-r--r-- | makefu/2configs/stats/external/weather2stats.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/makefu/2configs/stats/external/weather2stats.nix b/makefu/2configs/stats/external/weather2stats.nix new file mode 100644 index 000000000..870db99a8 --- /dev/null +++ b/makefu/2configs/stats/external/weather2stats.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: + +with import <stockholm/lib>; +let + pkg = pkgs.stdenv.mkDerivation { + name = "aralast-master"; + src = pkgs.fetchFromGitHub { + owner = "makefu"; + repo = "aralast"; + rev = "7121598"; + sha256 = "0vw027c698h9b69ksid5p3pji9960hd7n9xi4arrax0vfkwryb4m"; + }; + installPhase = '' + install -m755 -D aralast.sh $out/bin/aralast + ''; + }; +in { + systemd.services.aralast = { + description = "periodically fetch aramark"; + path = [ + pkgs.curl + pkgs.gnugrep + pkgs.gnused + ]; + wantedBy = [ "multi-user.target" ]; + environment = { + INFLUX_HOST = "localhost"; + INFLUX_PORT = "8086"; + }; + # every 10 seconds when the cantina is open + startAt = "Mon,Tue,Wed,Thu,Fri *-*-* 6,7,8,9,10,11,12,13,14,15:*:0,15,30,45"; + serviceConfig = { + User = "nobody"; + ExecStart = "${pkg}/bin/aralast"; + PrivateTmp = true; + }; + }; +} |