nixos-config/configs/pepe/home-assistant/heater-control.nix
2021-03-16 22:14:50 +01:00

16 lines
386 B
Nix

{ lib, pkgs, config, ... }: {
users.users.heater-control = { };
systemd.services.heater-control = {
enable = true;
wantedBy = [ "multi-user.target" ];
serviceConfig = { User = "heater-control"; };
script =
let myPython = pkgs.python3.withPackages (ps: with ps; [ paho-mqtt ]);
in ''
${myPython}/bin/python ${<mqtt/heater.py>}
'';
};
}