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; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
git
|
git
|
||||||
# (python3.withPackages (p: with p; [paho-mqtt mido])) # enable for local testing
|
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.mixer-mqtt = {
|
systemd.services.mixer-mqtt = {
|
||||||
wantedBy = [ "multi-user.target" ]; # auto-start at boot
|
wantedBy = ["multi-user.target"];
|
||||||
|
serviceConfig = let
|
||||||
serviceConfig = {
|
mixer_ip = "172.23.42.20";
|
||||||
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";
|
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";
|
Restart = "always";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
Environment = "PYTHONUNBUFFERED=1";
|
Environment = "PYTHONUNBUFFERED=1";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue