From 78c85d77ea18643b0f705509954b720b1d451f00 Mon Sep 17 00:00:00 2001 From: MakiseKurisu Date: Sat, 30 Aug 2025 12:14:25 +0800 Subject: [PATCH] home-assistant-custom-components.xiaomi_home: init at 0.4.2 --- .../custom-components/xiaomi_home/package.nix | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 pkgs/servers/home-assistant/custom-components/xiaomi_home/package.nix diff --git a/pkgs/servers/home-assistant/custom-components/xiaomi_home/package.nix b/pkgs/servers/home-assistant/custom-components/xiaomi_home/package.nix new file mode 100644 index 000000000000..ab8f04fcf308 --- /dev/null +++ b/pkgs/servers/home-assistant/custom-components/xiaomi_home/package.nix @@ -0,0 +1,59 @@ +{ + lib, + buildHomeAssistantComponent, + fetchFromGitHub, + construct, + paho-mqtt, + numpy, + cryptography, + psutil-home-assistant, + nix-update-script, +}: + +buildHomeAssistantComponent rec { + owner = "XiaoMi"; + domain = "xiaomi_home"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "XiaoMi"; + repo = "ha_xiaomi_home"; + rev = "v${version}"; + hash = "sha256-X8AP2pFGhkh4f72+pORXBB8yOqgIqJ+SLrQx5gwKxEg="; + }; + + dependencies = [ + construct + paho-mqtt + numpy + cryptography + psutil-home-assistant + ]; + + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=^v([0-9.]+)$" ]; }; + + meta = { + changelog = "https://github.com/XiaoMi/ha_xiaomi_home/releases/tag/v${version}"; + description = "Xiaomi Home Integration for Home Assistant"; + longDescription = '' + Xiaomi Home Integration for Home Assistant depends on additional components, example how to setup in NixOS `configuration.nix`: + + ``` + { config, lib, pkgs, ... }: + { + services.home-assistant = { + customComponents = [ pkgs.home-assistant-custom-components.xiaomi_home ]; + extraComponents = [ "ffmpeg" "zeroconf" ]; + }; + # OAuth2 Redirect URL is hardcoded as http://homeassistant.local:8123 + # Make sure you can access HA via this URL with mDNS + services.avahi.hostName = "homeassistant"; + networking.firewall.allowedTCPPorts = [ 8123 ]; + } + ``` + ''; + homepage = "https://github.com/XiaoMi/ha_xiaomi_home"; + maintainers = with lib.maintainers; [ MakiseKurisu ]; + license = lib.licenses.unfree; + }; +}