From ae329caf6f653ed34114f4f3c163ed1a5e3e7abf Mon Sep 17 00:00:00 2001 From: coon Date: Fri, 24 Oct 2025 20:29:44 +0000 Subject: [PATCH] mixer-mqtt service: run at boot + move ips into vars --- configuration.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configuration.nix b/configuration.nix index 1dd43af..3d5186c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -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";