diff options
author | lassulus <lass@lassul.us> | 2017-05-12 19:30:07 +0200 |
---|---|---|
committer | lassulus <lass@lassul.us> | 2017-05-12 19:30:07 +0200 |
commit | 58a7a56eeffe3f95beaab6d19d37c58a81b022f5 (patch) | |
tree | 385104ae2e65956c5529bac9213d066070d9d3cf /makefu/2configs/deployment | |
parent | d04f5af71e0861210a6a307aa8d3289abed2ada8 (diff) | |
parent | 39c264108329a412446c091852dd5a655da38b27 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/deployment')
-rw-r--r-- | makefu/2configs/deployment/led-fader.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/led-fader.nix b/makefu/2configs/deployment/led-fader.nix new file mode 100644 index 000000000..a18416497 --- /dev/null +++ b/makefu/2configs/deployment/led-fader.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with import <stockholm/lib>; +let + mq = "192.168.8.11"; + + pkg = pkgs.stdenv.mkDerivation { + name = "ampel-master"; + src = pkgs.fetchgit { + url = "http://cgit.euer.krebsco.de/ampel"; + rev = "07a6791de368e16cc0864d2676fd255eba522cee"; + sha256 = "1jxjapvkfglvgapy7gjbr1nra3ay418nvz70bvypcmv7wc8d4h8q"; + }; + buildInputs = [ + (pkgs.python35.withPackages (pythonPackages: with pythonPackages; [ + docopt + paho-mqtt + ])) + ]; + installPhase = '' + install -m755 -D fade.py $out/bin/fade.py + install -m755 -D ampel.py $out/bin/ampel + install -m755 -D times.json $out/share/times.json + ''; + }; +in { + systemd.services.led-fader = { + description = "Send led change to message queue"; + environment = { + NIX_PATH = "/var/src"; + }; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + # User = "nobody"; # need a user with permissions to run nix-shell + ExecStart = "${pkg}/bin/ampel 4 ${pkg}/share/times.json"; + PrivateTmp = true; + }; + }; +} |