mixer-mqtt service: run at boot + move ips into vars
This commit is contained in:
parent
5d39ab08f2
commit
ae329caf6f
1 changed files with 6 additions and 5 deletions
|
|
@ -19,14 +19,15 @@
|
|||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
git
|
||||
# (python3.withPackages (p: with p; [paho-mqtt mido])) # enable for local testing
|
||||
];
|
||||
|
||||
systemd.services.mixer-mqtt = {
|
||||
wantedBy = [ "multi-user.target" ]; # auto-start at boot
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.python3.withPackages (p: with p; [ paho-mqtt mido ])}/bin/python3 /root/mixer-rpc/mqtt_client.py 172.23.42.20 172.23.42.25";
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = let
|
||||
mixer_ip = "172.23.42.20";
|
||||
mqtt_ip = "172.23.42.25";
|
||||
in {
|
||||
ExecStart = "${pkgs.python3.withPackages (p: with p; [ paho-mqtt mido ])}/bin/python3 /root/mixer-rpc/mqtt_client.py ${mixer_ip} ${mqtt_ip}";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
Environment = "PYTHONUNBUFFERED=1";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue