From 67bb827098db223711df61fadeb98c0ff8d8343c Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Sun, 2 Mar 2025 14:56:03 +0100 Subject: [PATCH] HASS: custom spotify color recognize component --- flake.nix | 2 ++ instances/heimdall/configuration.nix | 3 +++ pkgs/hass-color-recognizer/default.nix | 30 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 pkgs/hass-color-recognizer/default.nix diff --git a/flake.nix b/flake.nix index 9700b98..47b3510 100644 --- a/flake.nix +++ b/flake.nix @@ -184,6 +184,7 @@ packages = { inherit (pkgs) + hass-color-recognizer keyboard-switch sddm-sugar-dark sddm-theme-clairvoyance @@ -238,6 +239,7 @@ wl-clipedit = self.callPackage ./pkgs/wl-clipedit { }; wl-lockscreen = self.callPackage ./pkgs/wl-lockscreen { }; wl-update-background = self.callPackage ./pkgs/wl-update-background { }; + hass-color-recognizer = self.callPackage ./pkgs/hass-color-recognizer { }; }; overrides = _self: super: { diff --git a/instances/heimdall/configuration.nix b/instances/heimdall/configuration.nix index 9b20988..d88ef9a 100644 --- a/instances/heimdall/configuration.nix +++ b/instances/heimdall/configuration.nix @@ -323,6 +323,9 @@ in configDir = "/var/lib/hass"; configWritable = true; extraPackages = ps: with ps; [ securetar ]; + customComponents = [ + pkgs.hass-color-recognizer + ]; extraComponents = [ "default_config" diff --git a/pkgs/hass-color-recognizer/default.nix b/pkgs/hass-color-recognizer/default.nix new file mode 100644 index 0000000..0f6141e --- /dev/null +++ b/pkgs/hass-color-recognizer/default.nix @@ -0,0 +1,30 @@ +{ fetchFromGitHub, python3Packages, buildHomeAssistantComponent }: + +buildHomeAssistantComponent { + owner = "zewelor"; + domain = "hass-color-recognizer"; + version = "6e99269"; + + src = fetchFromGitHub { + owner = "zewelor"; + repo = "ha_custom_components"; + rev = "6e99269"; + sha256 = "sha256-0Qgtt5gMOUZQphUkI6uYiZ/A8xsXP1eMrVlC+EmjXj8="; + }; + + propagatedBuildInputs = [ + python3Packages.numpy + python3Packages.scipy + python3Packages.voluptuous + ]; + + doCheck = false; + + pythonImportsCheck = [ "numpy" "scipy" "voluptuous" ]; + + installPhase = '' + runHook preInstall + cp -a color_recognizer $out + runHook postInstall + ''; +}