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";