From ea0e976056ee1b1652a51dc1ae3b02debf80e74d Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Mon, 29 Jun 2020 23:13:58 +0100 Subject: catbus mqttBroker parameters are URLs --- nixos/modules/services/catbus-actuator-wakeonlan.nix | 17 +++++------------ nixos/modules/services/catbus-lgtv.nix | 17 +++++------------ .../services/catbus-observer-networkpresence.nix | 17 +++++------------ 3 files changed, 15 insertions(+), 36 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/catbus-actuator-wakeonlan.nix b/nixos/modules/services/catbus-actuator-wakeonlan.nix index 84839e6..c78f974 100644 --- a/nixos/modules/services/catbus-actuator-wakeonlan.nix +++ b/nixos/modules/services/catbus-actuator-wakeonlan.nix @@ -6,7 +6,7 @@ let cfg = config.eth.services.catbus-actuator-wakeonlan; configJSON = pkgs.writeText "config.json" (builtins.toJSON { - mqttBroker = "tcp://${cfg.mqttBroker.host}:${toString cfg.mqttBroker.port}"; + mqttBroker = cfg.mqttBroker; devices = cfg.devices; }); @@ -16,17 +16,10 @@ in { enable = mkEnableOption "Whether to enable the Catbus Wake-On-LAN actuator"; - mqttBroker = { - host = mkOption { - type = types.str; - description = "Host of the MQTT broker."; - example = "localhost"; - }; - port = mkOption { - type = types.int; - description = "Port of the MQTT broker."; - default = 1883; - }; + mqttBroker = mkOption { + type = types.str; + description = "URL of the MQTT broker."; + example = "tcp://broker.local:1883"; }; devices = mkOption { diff --git a/nixos/modules/services/catbus-lgtv.nix b/nixos/modules/services/catbus-lgtv.nix index 8011004..9b2af13 100644 --- a/nixos/modules/services/catbus-lgtv.nix +++ b/nixos/modules/services/catbus-lgtv.nix @@ -6,7 +6,7 @@ let cfg = config.eth.services.catbus-lgtv; configJSON = pkgs.writeText "config.json" (builtins.toJSON { - mqttBroker = "tcp://${cfg.mqttBroker.host}:${toString cfg.mqttBroker.port}"; + mqttBroker = cfg.mqttBroker; apps = cfg.apps; topics = { app = cfg.topics.input; @@ -23,17 +23,10 @@ in { enable = mkEnableOption "Whether to enable the Catbus WebOS LGTV daemons."; - mqttBroker = { - host = mkOption { - type = types.str; - description = "Host of the MQTT broker."; - example = "localhost"; - }; - port = mkOption { - type = types.int; - description = "Port of the MQTT broker."; - default = 1883; - }; + mqttBroker = mkOption { + type = types.str; + description = "URL of the MQTT broker."; + example = "tcp://broker.local:1883"; }; tv = { diff --git a/nixos/modules/services/catbus-observer-networkpresence.nix b/nixos/modules/services/catbus-observer-networkpresence.nix index 528ab66..da54956 100644 --- a/nixos/modules/services/catbus-observer-networkpresence.nix +++ b/nixos/modules/services/catbus-observer-networkpresence.nix @@ -6,7 +6,7 @@ let cfg = config.eth.services.catbus-observer-networkpresence; configJSON = pkgs.writeText "config.json" (builtins.toJSON { - mqttBroker = "tcp://${cfg.mqttBroker.host}:${toString cfg.mqttBroker.port}"; + mqttBroker = cfg.mqttBroker; devices = cfg.devices; }); @@ -23,17 +23,10 @@ in { example = "enp2s0"; }; - mqttBroker = { - host = mkOption { - type = types.str; - description = "Host of the MQTT broker."; - example = "localhost"; - }; - port = mkOption { - type = types.int; - description = "Port of the MQTT broker."; - default = 1883; - }; + mqttBroker = mkOption { + type = types.str; + description = "URL of the MQTT broker."; + example = "tcp://broker.local:1883"; }; devices = mkOption { -- cgit v1.2.3