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

24 lines
678 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";
2019-03-06 15:42:27 +00:00
ExecStart = "${pkg}/bin/ampel";
2017-12-08 13:04:35 +00:00
Restart = "always";
RestartSec = 10;
2017-05-11 10:07:03 +00:00
PrivateTmp = true;
};
};
}