stockholm/makefu/2configs/deployment/led-fader.nix

24 lines
680 B
Nix
Raw Normal View History

2017-12-08 13:04:35 +00:00
{ config, lib, pkgs, buildPythonPackage, ... }:
2017-05-11 10:07:03 +00:00
let
mq = "192.168.8.11";
2018-02-06 10:56:36 +00:00
pkg = pkgs.ampel;
2017-05-11 10:07:03 +00:00
in {
systemd.services.led-fader = {
description = "Send led change to message queue";
environment = {
NIX_PATH = "/var/src";
};
2017-09-29 19:36:01 +00:00
after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service");
wantedBy = [ "multi-user.target" ];
2017-05-11 10:07:03 +00:00
serviceConfig = {
# User = "nobody"; # need a user with permissions to run nix-shell
2017-09-29 19:36:01 +00:00
ExecStartPre = pkgs.writeDash "sleep.sh" "sleep 2";
2017-12-08 13:04:35 +00:00
ExecStart = "${pkg}/bin/ampel 4";
Restart = "always";
RestartSec = 10;
2017-05-11 10:07:03 +00:00
PrivateTmp = true;
};
};
}