nixpkgs/nixos/modules/services/misc/domoticz.nix
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00

53 lines
1.1 KiB
Nix

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.services.domoticz;
pkgDesc = "Domoticz home automation";
in {
options = {
services.domoticz = {
enable = mkEnableOption pkgDesc;
bind = mkOption {
type = types.str;
default = "0.0.0.0";
description = "IP address to bind to.";
};
port = mkOption {
type = types.port;
default = 8080;
description = "Port to bind to for HTTP, set to 0 to disable HTTP.";
};
};
};
config = mkIf cfg.enable {
systemd.services."domoticz" = {
description = pkgDesc;
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
DynamicUser = true;
StateDirectory = "domoticz";
Restart = "always";
ExecStart = ''
${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
'';
};
};
};
}