diff --git a/configurations/android/nix-on-droid.nix b/configurations/android/nix-on-droid.nix index e081ae75..16abfb8e 100644 --- a/configurations/android/nix-on-droid.nix +++ b/configurations/android/nix-on-droid.nix @@ -46,7 +46,7 @@ ideConfig = { enableJava = false; - enableNix= false; + enableNix = false; enablePython = false; }; }; diff --git a/scopedPackages/hass-components/default.nix b/scopedPackages/hass-components/default.nix index 904e86c8..a4906c2a 100644 --- a/scopedPackages/hass-components/default.nix +++ b/scopedPackages/hass-components/default.nix @@ -1,17 +1,33 @@ { lib, pkgs, + self, ... } @ inputs: lib.makeScope pkgs.newScope (hass: let + inherit (self.lib) mergeAttrsList; + + python3Packages = pkgs.python312Packages.override { + overrides = final: prev: (mergeAttrsList (map (x: x python3Packages final prev) [ + (import ./spotifyplus/overrides.nix ({inherit pkgs;} // inputs)) + (import ./tuya-local/overrides.nix {inherit pkgs;}) + ])); + }; + buildHassComponent = file: extraArgs: - hass.callPackage file (inputs // extraArgs // {}); + hass.callPackage file (inputs // extraArgs // {inherit python3Packages;}); in { extended-ollama-conversation = buildHassComponent ./extended-ollama-conversation {}; + ha-fallback-conversation = buildHassComponent ./ha-fallback-conversation {}; + material-symbols = buildHassComponent ./material-symbols {}; + netdaemon = buildHassComponent ./netdaemon {}; - spotifyplus = import ./spotifyplus ({inherit buildHassComponent;} // inputs); - tuya-local = import ./tuya-local ({inherit buildHassComponent;} // inputs); + + spotifyplus = buildHassComponent ./spotifyplus {}; + + tuya-local = buildHassComponent ./tuya-local {}; + yamaha-soundbar = buildHassComponent ./yamaha-soundbar {}; }) diff --git a/scopedPackages/hass-components/spotifyplus/default.nix b/scopedPackages/hass-components/spotifyplus/default.nix index bf09a40c..bd422eb4 100644 --- a/scopedPackages/hass-components/spotifyplus/default.nix +++ b/scopedPackages/hass-components/spotifyplus/default.nix @@ -1,23 +1,29 @@ { - self, - buildHassComponent, - smartinspect-src, - spotifywebapi-src, - pkgs, + spotifyplus-src, + buildHomeAssistantComponent, + python3Packages, ... }: let - python3Packages = pkgs.python3Packages.override { - overrides = _: super: rec { - smartinspect = pkgs.callPackage ./smartinspect.nix { - inherit python3Packages smartinspect-src; - }; - spotifywebapi = pkgs.callPackage ./spotifywebapi.nix { - inherit python3Packages smartinspect spotifywebapi-src; - }; - urllib3 = self.packages.${pkgs.system}.urllib3.override { - inherit python3Packages; - }; - }; - }; + inherit (builtins) fromJSON readFile; + + manifest = fromJSON (readFile "${spotifyplus-src}/custom_components/spotifyplus/manifest.json"); in - buildHassComponent ./spotifyplus.nix {inherit python3Packages;} + buildHomeAssistantComponent { + owner = "thlucas1"; + + inherit (manifest) domain version; + + src = spotifyplus-src; + + propagatedBuildInputs = with python3Packages; [ + oauthlib + platformdirs + requests + requests_oauthlib + soco + urllib3 + zeroconf + smartinspect # overridden in python3Packages + spotifywebapi # overridden in python3Packages + ]; + } diff --git a/scopedPackages/hass-components/spotifyplus/overrides.nix b/scopedPackages/hass-components/spotifyplus/overrides.nix new file mode 100644 index 00000000..60cb9210 --- /dev/null +++ b/scopedPackages/hass-components/spotifyplus/overrides.nix @@ -0,0 +1,17 @@ +{ + self, + smartinspect-src, + spotifywebapi-src, + pkgs, + ... +}: python3Packages: final: prev: rec { + smartinspect = pkgs.callPackage ./smartinspect.nix { + inherit python3Packages smartinspect-src; + }; + spotifywebapi = pkgs.callPackage ./spotifywebapi.nix { + inherit python3Packages smartinspect spotifywebapi-src; + }; + urllib3 = self.packages.${pkgs.system}.urllib3.override { + inherit python3Packages; + }; +} diff --git a/scopedPackages/hass-components/spotifyplus/spotifyplus.nix b/scopedPackages/hass-components/spotifyplus/spotifyplus.nix deleted file mode 100644 index 82a8bf98..00000000 --- a/scopedPackages/hass-components/spotifyplus/spotifyplus.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - spotifyplus-src, - buildHomeAssistantComponent, - python3Packages, - ... -}: let - inherit (builtins) fromJSON readFile; - - manifest = fromJSON (readFile "${spotifyplus-src}/custom_components/spotifyplus/manifest.json"); -in - buildHomeAssistantComponent { - owner = "thlucas1"; - - inherit (manifest) domain version; - - src = spotifyplus-src; - - propagatedBuildInputs = with python3Packages; [ - oauthlib - platformdirs - requests - requests_oauthlib - soco - urllib3 - zeroconf - smartinspect # overridden in this python3Packages - spotifywebapi # overridden in this python3Packages - ]; - } diff --git a/scopedPackages/hass-components/spotifyplus/spotifywebapi.nix b/scopedPackages/hass-components/spotifyplus/spotifywebapi.nix index 0e65f299..4545fc0e 100644 --- a/scopedPackages/hass-components/spotifyplus/spotifywebapi.nix +++ b/scopedPackages/hass-components/spotifyplus/spotifywebapi.nix @@ -22,7 +22,7 @@ in setuptools urllib3 zeroconf - smartinspect # overridden in this python3Packages + smartinspect # overridden in python3Packages ]; pythonImportsCheck = [ diff --git a/scopedPackages/hass-components/tuya-local/default.nix b/scopedPackages/hass-components/tuya-local/default.nix index 34c92b29..53010744 100644 --- a/scopedPackages/hass-components/tuya-local/default.nix +++ b/scopedPackages/hass-components/tuya-local/default.nix @@ -1,20 +1,22 @@ { - buildHassComponent, - pkgs, + tuya-local-src, + buildHomeAssistantComponent, + python3Packages, ... }: let - python3Packages = pkgs.python3Packages.override { - overrides = final: prev: { - tinytuya = prev.tinytuya.overridePythonAttrs (o: rec { - version = "1.16.0"; - src = pkgs.fetchFromGitHub { - owner = "jasonacox"; - repo = "tinytuya"; - rev = "v${version}"; - hash = "sha256-K65kZjLa5AJG9FEYAs/Jf2UC8qiP7BkC8znHMHMYeg4="; - }; - }); - }; - }; + inherit (builtins) fromJSON readFile; + + manifest = fromJSON (readFile "${tuya-local-src}/custom_components/tuya_local/manifest.json"); in - buildHassComponent ./tinytuya.nix {inherit python3Packages;} + buildHomeAssistantComponent { + owner = "make-all"; + + inherit (manifest) domain version; + + src = tuya-local-src; + + propagatedBuildInputs = with python3Packages; [ + tinytuya + tuya-device-sharing-sdk + ]; + } diff --git a/scopedPackages/hass-components/tuya-local/overrides.nix b/scopedPackages/hass-components/tuya-local/overrides.nix new file mode 100644 index 00000000..eb16a346 --- /dev/null +++ b/scopedPackages/hass-components/tuya-local/overrides.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: python3Packages: final: prev: { + tinytuya = prev.tinytuya.overridePythonAttrs (o: rec { + version = "1.16.0"; + src = pkgs.fetchFromGitHub { + owner = "jasonacox"; + repo = "tinytuya"; + rev = "v${version}"; + hash = "sha256-K65kZjLa5AJG9FEYAs/Jf2UC8qiP7BkC8znHMHMYeg4="; + }; + }); +} diff --git a/scopedPackages/hass-components/tuya-local/tinytuya.nix b/scopedPackages/hass-components/tuya-local/tinytuya.nix deleted file mode 100644 index 53010744..00000000 --- a/scopedPackages/hass-components/tuya-local/tinytuya.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - tuya-local-src, - buildHomeAssistantComponent, - python3Packages, - ... -}: let - inherit (builtins) fromJSON readFile; - - manifest = fromJSON (readFile "${tuya-local-src}/custom_components/tuya_local/manifest.json"); -in - buildHomeAssistantComponent { - owner = "make-all"; - - inherit (manifest) domain version; - - src = tuya-local-src; - - propagatedBuildInputs = with python3Packages; [ - tinytuya - tuya-device-sharing-sdk - ]; - }