nixos-config/2configs/bam/led-fader.nix

24 lines
678 B
Nix
Raw Normal View History

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