{ config, lib, pkgs, ... }: with lib; let cfg = config.local.home-assistant; in { options.local.home-assistant = { enable = mkEnableOption "home-assistant"; }; config = mkIf cfg.enable { local.boot.impermanence.directories = [ { directory = "/var/lib/hass"; user = "hass"; group = "hass"; mode = "u=rwx,g=,o="; } ]; services.home-assistant = { enable = true; extraComponents = [ "met" "google_translate" "radio_browser" "tuya" "xiaomi_miio" ]; config = { # Includes dependencies for a basic setup # https://www.home-assistant.io/integrations/default_config/ default_config = { }; }; customComponents = with pkgs.home-assistant-custom-components; [ dreame_vacuum xiaomi_miot ]; customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ xiaomi-vacuum-map-card ]; }; }; }