diff --git a/hosts/pi/default.nix b/hosts/pi/default.nix index ec40ac5..c60d182 100644 --- a/hosts/pi/default.nix +++ b/hosts/pi/default.nix @@ -1,6 +1,4 @@ { - config, - lib, pkgs, self, ... @@ -114,122 +112,6 @@ pulse.enable = true; }; - age.secrets."files/services/home-assistant/secrets.yaml" = { - file = "${self.inputs.secrets}/files/services/home-assistant/secrets.yaml.age"; - path = "${config.services.home-assistant.configDir}/secrets.yaml"; - owner = "hass"; - group = "hass"; - }; - - services.home-assistant = { - enable = true; - extraComponents = [ - "api" - "alert" - "auth" - "backup" - "command_line" - "default_config" - "homekit_controller" - "homekit" - "http" - "icloud" - "jellyfin" - "metoffice" - "mqtt" - "onkyo" - "ping" - "proximity" - "radio_browser" - "scrape" - "sensor" - "system_health" - ]; - config = { - default_config = { }; - backup = { }; - homeassistant = { - name = "Home"; - latitude = "!secret latitude"; - longitude = "!secret longitude"; - country = "GB"; - temperature_unit = "C"; - time_zone = config.time.timeZone; - unit_system = "metric"; - }; - mqtt = { }; - scene = "!include scenes.yaml"; - automation = "!include automations.yaml"; - system_health = { }; - recorder = { - purge_keep_days = 365; - }; - }; - }; - - services.mosquitto = { - enable = true; - listeners = [ - { - acl = [ "pattern readwrite #" ]; - omitPasswordAuth = true; - port = 1883; - settings = { - allow_anonymous = true; - }; - } - ]; - }; - - age.secrets."files/services/zigbee2mqtt/secret.yaml" = { - file = "${self.inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age"; - path = "${config.services.zigbee2mqtt.dataDir}/secret.yaml"; - owner = "zigbee2mqtt"; - group = "zigbee2mqtt"; - }; - - services.zigbee2mqtt = { - package = pkgs.unstable.zigbee2mqtt; - enable = true; - dataDir = "/var/lib/zigbee2mqtt"; - settings = { - homeassistant = lib.optionalAttrs config.services.home-assistant.enable { - discovery_topic = "homeassistant"; - status_topic = "hass/status"; - legacy_entity_attributes = true; - legacy_triggers = true; - }; - availability = true; - frontend = true; - device_options = { - retain = true; - }; - serial = { - port = "/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0"; - }; - advanced = { - channel = 20; - network_key = "!secret.yaml network_key"; - pan_id = 13001; - ext_pan_id = [ - 79 - 1 - 73 - 47 - 250 - 136 - 124 - 222 - ]; - transmit_power = 20; - }; - mqtt = { - version = 5; - server = "mqtt://localhost:1883"; - }; - }; - }; - modules = { system = { wireless = { @@ -240,12 +122,9 @@ services = { borgmatic = { enable = true; - directories = [ - "/var/lib/mosquitto" - "/var/lib/zigbee2mqtt" - ]; repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo"; }; + home-assistant.enable = true; }; };