1 { lib, pkgs, config, ... }:
4 cfg = config.services.domoticz;
5 pkgDesc = "Domoticz home automation";
12 enable = lib.mkEnableOption pkgDesc;
17 description = "IP address to bind to.";
21 type = lib.types.port;
23 description = "Port to bind to for HTTP, set to 0 to disable HTTP.";
30 config = lib.mkIf cfg.enable {
32 systemd.services."domoticz" = {
33 description = pkgDesc;
34 wantedBy = [ "multi-user.target" ];
35 wants = [ "network-online.target" ];
36 after = [ "network-online.target" ];
39 StateDirectory = "domoticz";
42 ${pkgs.domoticz}/bin/domoticz -noupdates -www ${toString cfg.port} -wwwbind ${cfg.bind} -sslwww 0 -userdata /var/lib/domoticz -approot ${pkgs.domoticz}/share/domoticz/ -pidfile /var/run/domoticz.pid