8 cfg = config.services.usbrelayd;
11 options.services.usbrelayd = with lib.types; {
12 enable = lib.mkEnableOption "USB Relay MQTT daemon";
14 broker = lib.mkOption {
16 description = "Hostname or IP address of your MQTT Broker.";
17 default = "127.0.0.1";
24 clientName = lib.mkOption {
26 description = "Name, your client connects as.";
27 default = "MyUSBRelay";
31 config = lib.mkIf cfg.enable {
33 environment.etc."usbrelayd.conf".text = ''
35 BROKER = ${cfg.broker}
36 CLIENTNAME = ${cfg.clientName}
39 services.udev.packages = [ pkgs.usbrelayd ];
40 systemd.packages = [ pkgs.usbrelayd ];
41 users.groups.usbrelay = { };
45 maintainers = with lib.maintainers; [ wentasah ];