1 { config, lib, pkgs, ... }:
4 cfg = config.services.usbrelayd;
7 options.services.usbrelayd = with types; {
8 enable = mkEnableOption "USB Relay MQTT daemon";
12 description = "Hostname or IP address of your MQTT Broker.";
13 default = "127.0.0.1";
20 clientName = mkOption {
22 description = "Name, your client connects as.";
23 default = "MyUSBRelay";
27 config = mkIf cfg.enable {
29 environment.etc."usbrelayd.conf".text = ''
31 BROKER = ${cfg.broker}
32 CLIENTNAME = ${cfg.clientName}
35 services.udev.packages = [ pkgs.usbrelayd ];
36 systemd.packages = [ pkgs.usbrelayd ];
37 users.groups.usbrelay = { };
41 maintainers = with lib.maintainers; [ wentasah ];